Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions plugins/french/novelfrance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class NovelFrancePlugin implements Plugin.PluginBase {
name = 'NovelFrance';
icon = 'src/fr/novelfrance/icon.png';
site = 'https://novelfrance.fr/';
version = '1.0.0';
version = '1.0.1';

private async fetchJson<T>(url: string): Promise<T> {
const r = await fetchApi(url);
Expand Down Expand Up @@ -205,9 +205,14 @@ class NovelFrancePlugin implements Plugin.PluginBase {
if (title) parts.push(`<h1>${this.escapeHtml(title)}</h1>`);

for (const p of data.paragraphs || []) {
if (title && p.index === 0) continue;
const content = (p.content || '').trim();
if (!content) continue;

// Si le paragraphe d'index 0 est une répétition exacte du titre du chapitre, on l'ignore
if (title && p.index === 0 && content.toLowerCase() === title.trim().toLowerCase()) {
continue;
}

parts.push(`<p>${this.escapeHtml(content)}</p>`);
}

Expand Down
Loading