Skip to content

Commit

Permalink
fix quanben.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Jul 30, 2024
1 parent d820090 commit b75f61c
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions novel.cmn-Hans-CN/quanben.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,32 @@ var crawler = new CeL.work_crawler({
this.check_next_chapter(work_data, chapter_NO, html);

var chapter_data = work_data.chapter_list[chapter_NO - 1],
//
text = html.between('<div id="content">', '</div>');
/**
* 2024/7/7 e.g.,<code>
<div id="content">
<div id="container-1889c51b2f8f6f13650dadd3e7345667"></div>
<p>...</p><p>...</p><!--PAGE 3-->
</div>
<div class="nlist_page">
...
</div>
</code>
*/
text = html.between('<div id="content">').replace(
/<div[^<>]*><\/div>/g, '').between(null, '</div>');

// 去除註解。 Remove comments.
text = text.replace(/<\!--[\s\S]*?-->/g, '');

// 有些章節會先以章節標題起頭。
text = CeL.work_crawler.trim_start_title(text, chapter_data);

text = CeL.work_crawler.fix_general_censorship(text);

text = text.trim();

this.add_ebook_chapter(work_data, chapter_NO, {
title : chapter_data.part_title,
sub_title : chapter_data.title
Expand Down

0 comments on commit b75f61c

Please sign in to comment.