Skip to content

Commit a312351

Browse files
committed
chapterContent cleanup
1 parent 8231f91 commit a312351

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

plugins/english/novelupdates.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Plugin } from '@/types/plugin';
66
class NovelUpdates implements Plugin.PluginBase {
77
id = 'novelupdates';
88
name = 'Novel Updates';
9-
version = '0.9.11';
9+
version = '0.9.12';
1010
icon = 'src/en/novelupdates/icon.png';
1111
customCSS = 'src/en/novelupdates/customCSS.css';
1212
site = 'https://www.novelupdates.com/';
@@ -617,6 +617,16 @@ class NovelUpdates implements Plugin.PluginBase {
617617
// 5. All lines from the content segment are paragraphs.
618618
chapterContent = lines.map((p: string) => `<p>${p}</p>`).join('\n');
619619

620+
// Clean up custom markup tags:
621+
// Format [dialogue speaker="Name"]text[/dialogue] as "Name: text", drop [sfx] blocks entirely
622+
chapterContent = chapterContent
623+
.replace(
624+
/\[dialogue\s+speaker="([^"]*)"\](.*?)\[\/dialogue\]/gi,
625+
'$1: $2',
626+
)
627+
.replace(/\[sfx\].*?\[\/sfx\]/gi, '')
628+
.replace(/\[\/?(dialogue|sfx)[^\]]*\]/gi, '');
629+
620630
break;
621631
}
622632
// Last edited in 0.9.0 by Batorian - 19/03/2025

0 commit comments

Comments
 (0)