Skip to content

Commit f6486a7

Browse files
committed
fix
1 parent 83c06a1 commit f6486a7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:zh-TW 懶人小説下載器
55
// @name:ja 怠惰者小説ダウンロードツール
66
// @namespace hoothin
7-
// @version 1.17
7+
// @version 1.18
88
// @description Fetch and download main content on current page, provide special support for chinese novel
99
// @description:zh-CN 通用网站内容抓取工具,可批量抓取小说、论坛内容等并保存为TXT文档
1010
// @description:zh-TW 通用網站內容抓取工具,可批量抓取小說、論壇內容等並保存為TXT文檔
@@ -192,12 +192,12 @@
192192
for(let j=0;j<childNodes.length;j++){
193193
let childNode=childNodes[j];
194194
if(childNode.nodeType==3 && childNode.data && !/^\s*$/.test(childNode.data))hasText=true;
195-
if(childNode.textContent){
196-
cStr+=childNode.textContent.replace(/ +/g," ").replace(/([^\r]|^)\n([^\r]|$)/g,"$1\r\n$2");
197-
}
198195
if(childNode.innerHTML){
199196
childNode.innerHTML=childNode.innerHTML.replace(/\<\s*br\s*\>/gi,"\r\n");
200197
}
198+
if(childNode.textContent){
199+
cStr+=childNode.textContent.replace(/ +/g," ");
200+
}
201201
if(childNode.nodeType!=3 && !/^(I|A|STRONG|B|FONT)$/.test(childNode.tagName))cStr+="\r\n";
202202
}
203203
if(hasText || noTextEnable || ele==largestContent)rStr+=cStr+"\r\n";

0 commit comments

Comments
 (0)