Skip to content

Commit ccdd39c

Browse files
committed
fix
1 parent 425b014 commit ccdd39c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 4 additions & 1 deletion
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.09
7+
// @version 1.10
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文檔
@@ -164,6 +164,9 @@
164164
for(let j=0;j<childNodes.length;j++){
165165
let childNode=childNodes[j];
166166
if(childNode.nodeType==3 && childNode.data && !/^\s*$/.test(childNode.data))hasText=true;
167+
if(childNode.innerHTML){
168+
childNode.innerHTML=childNode.innerHTML.replace(/\<\s*br\s*\>/gi,"\r\n");
169+
}
167170
if(childNode.textContent){
168171
cStr+=childNode.textContent.replace(/ +/g," ").replace(/([^\r]|^)\n([^\r]|$)/g,"$1\r\n$2");
169172
}

0 commit comments

Comments
 (0)