From e0b1d3da2a9451b8681ceedee2039f0e6f74f6ee Mon Sep 17 00:00:00 2001 From: xMohnad Date: Sat, 21 Jun 2025 08:31:04 +0000 Subject: [PATCH] kolnovel: avoid removing chapter number if it's inside parentheses --- javascript/novel/src/ar/kolnovel.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/javascript/novel/src/ar/kolnovel.js b/javascript/novel/src/ar/kolnovel.js index 42b774a3..ce061d76 100644 --- a/javascript/novel/src/ar/kolnovel.js +++ b/javascript/novel/src/ar/kolnovel.js @@ -164,8 +164,12 @@ class DefaultExtension extends MProvider { if (title.includes(name)) title = title.replace(name, "").trim(); const numMatch = num.match(/(?:الفصل|chapter)\s+(\d+(?:\.\d+)?)/i); - if (numMatch) - title = title.replace(numMatch[0], "").replace(numMatch[1], "").trim(); + if (numMatch) { + title = title.replace(numMatch[0], "").trim(); + if (!title.includes(`(${numMatch[1]})`)) { + title = title.replace(numMatch[1], "").trim(); + } + } title = title.replace(/\s{2,}/g, " ").trim(); const finalName =