mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
56bc7a2687
commit
86f6650ec7
2 changed files with 630 additions and 612 deletions
|
@ -1288,6 +1288,10 @@ let keytextres = []
|
|||
let fulltext=[]
|
||||
let article
|
||||
let sentences=[]
|
||||
var articlePromise = new Promise((resolve, reject) => {
|
||||
|
||||
});
|
||||
|
||||
function modal_open(url, num)
|
||||
{
|
||||
if(lock_chat==1) return;
|
||||
|
@ -1484,22 +1488,27 @@ function modal_open(url, num)
|
|||
return 0;
|
||||
});
|
||||
|
||||
}).catch(function(error) {
|
||||
console.error(error); //处理错误情况
|
||||
});
|
||||
|
||||
modalele = ['这是一个PDF文档']
|
||||
sentencesContent = ''
|
||||
for (let i = 0; i < sentences.length; i++) {
|
||||
sentencesContent += sentences[i][1];
|
||||
}
|
||||
article = {'textContent':sentencesContent,'title':iframe.contentWindow.PDFViewerApplication._title}
|
||||
|
||||
|
||||
}).catch(function(error) {
|
||||
console.error(error); //处理错误情况
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
modalele = eleparse(iframe.contentDocument);
|
||||
article = new Readability(iframe.contentDocument.cloneNode(true)).parse();
|
||||
}
|
||||
|
||||
}).then(
|
||||
() => {
|
||||
fulltext = article.textContent;
|
||||
fulltext = fulltext.replaceAll("\n\n","\n").replaceAll("\n\n","\n");
|
||||
const delimiter = /[?!;\?\n。;!………]/g
|
||||
|
|
|
@ -1288,6 +1288,10 @@ let keytextres = []
|
|||
let fulltext=[]
|
||||
let article
|
||||
let sentences=[]
|
||||
var articlePromise = new Promise((resolve, reject) => {
|
||||
|
||||
});
|
||||
|
||||
function modal_open(url, num)
|
||||
{
|
||||
if(lock_chat==1) return;
|
||||
|
@ -1484,22 +1488,27 @@ function modal_open(url, num)
|
|||
return 0;
|
||||
});
|
||||
|
||||
}).catch(function(error) {
|
||||
console.error(error); //处理错误情况
|
||||
});
|
||||
|
||||
modalele = ['这是一个PDF文档']
|
||||
sentencesContent = ''
|
||||
for (let i = 0; i < sentences.length; i++) {
|
||||
sentencesContent += sentences[i][1];
|
||||
}
|
||||
article = {'textContent':sentencesContent,'title':iframe.contentWindow.PDFViewerApplication._title}
|
||||
|
||||
|
||||
}).catch(function(error) {
|
||||
console.error(error); //处理错误情况
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
modalele = eleparse(iframe.contentDocument);
|
||||
article = new Readability(iframe.contentDocument.cloneNode(true)).parse();
|
||||
}
|
||||
|
||||
}).then(
|
||||
() => {
|
||||
fulltext = article.textContent;
|
||||
fulltext = fulltext.replaceAll("\n\n","\n").replaceAll("\n\n","\n");
|
||||
const delimiter = /[?!;\?\n。;!………]/g
|
||||
|
|
Loading…
Add table
Reference in a new issue