Add files via upload

This commit is contained in:
gaotianliuyun
2022-10-09 22:16:48 +08:00
committed by GitHub
parent 54c0677532
commit 052eb7b3a5
4 changed files with 572 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
import './uri.min.js'
import cheerio from './cheerio.min.js';
import './crypto-js.js'
import './dayjs.min.js'
import _ from './underscore-esm-min.js'
import 'assets://js/lib/uri.min.js'
import cheerio from 'assets://js/lib/cheerio.min.js';
import 'assets://js/lib/crypto-js.js'
import 'assets://js/lib/dayjs.min.js'
import _ from 'assets://js/lib/underscore-esm-min.js'
var charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
export function randIndex(min, max, i) {
@@ -235,7 +235,7 @@ export function pdfh(html, parse, base_url) {
}
let result = '';
const $ = eleFind ? html.rr : cheerio.load(html);
let ret = eleFind ? (parse === '*=*' ? html.ele : $(html.ele).find(parse)) : $(parse);
let ret = eleFind ? ((parse === '*=*' || $(html.ele).is(parse)) ? html.ele : $(html.ele).find(parse)) : $(parse);
if (option) {
if (option === 'Text') {
result = $(ret).text();
@@ -274,7 +274,7 @@ export function pdfa(html, parse) {
parse = sp.join(' ');
}
const $ = eleFind ? html.rr : cheerio.load(html);
let ret = eleFind ? $(html.ele).find(parse) : $(parse);
let ret = eleFind ? ($(html.ele).is(parse) ? html.ele : $(html.ele).find(parse)) : $(parse);
let result = [];
if (ret) {
ret.each(function (idx, ele) {