LightNovelWP: Fix summary formatting (#1827)
* LightNovelWP: Fix summary formatting * fix <br> summary
This commit is contained in:
@@ -42,7 +42,7 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
|
||||
this.icon = `multisrc/lightnovelwp/${metadata.id.toLowerCase()}/icon.png`;
|
||||
this.site = metadata.sourceSite;
|
||||
const versionIncrements = metadata.options?.versionIncrements || 0;
|
||||
this.version = `1.1.${8 + versionIncrements}`;
|
||||
this.version = `1.1.${9 + versionIncrements}`;
|
||||
this.options = metadata.options ?? ({} as LightNovelWPOptions);
|
||||
this.filters = metadata.filters satisfies Filters;
|
||||
|
||||
@@ -242,7 +242,7 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
|
||||
}
|
||||
} // summary
|
||||
else if (isReadingSummary === 1 && data.trim()) {
|
||||
novel.summary += data.trim() + '\n';
|
||||
novel.summary += data;
|
||||
} // author and status
|
||||
else if (isParsingInfo) {
|
||||
if (isReadingInfo) {
|
||||
@@ -363,7 +363,9 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
|
||||
}
|
||||
} // summary
|
||||
else if (isReadingSummary) {
|
||||
if (name === 'br') {
|
||||
if (name === 'p') {
|
||||
novel.summary += '\n\n';
|
||||
} else if (name === 'br') {
|
||||
novel.summary += '\n';
|
||||
} else if (name === 'div' || name === 'script') {
|
||||
isReadingSummary--;
|
||||
@@ -419,6 +421,8 @@ class LightNovelWPPlugin implements Plugin.PluginBase {
|
||||
novel.chapters = chapters;
|
||||
}
|
||||
|
||||
novel.summary = novel.summary.trim();
|
||||
|
||||
return novel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user