File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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文檔
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 * b r \s * \> / gi, "\r\n" ) ;
200197 }
198+ if ( childNode . textContent ) {
199+ cStr += childNode . textContent . replace ( / + / g, " " ) ;
200+ }
201201 if ( childNode . nodeType != 3 && ! / ^ ( I | A | S T R O N G | B | F O N T ) $ / . test ( childNode . tagName ) ) cStr += "\r\n" ;
202202 }
203203 if ( hasText || noTextEnable || ele == largestContent ) rStr += cStr + "\r\n" ;
You can’t perform that action at this time.
0 commit comments