From 41f0d592571f7066e785f9a4598fa48e26f1c0a0 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 14 Oct 2024 06:41:14 -0300 Subject: replacer: auto-colorize whole summary by default --- src/util/replacer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/util/replacer.js b/src/util/replacer.js index a11e9c8f..74e18873 100644 --- a/src/util/replacer.js +++ b/src/util/replacer.js @@ -614,10 +614,15 @@ export function postprocessSummaries(inputNodes) { textContent += node.data.slice(parseFrom, match.index); parseFrom = match.index + match[0].length; - // We're wrapping the contents of the with a . - // This means we have to add the closing where the summary ends. + const colorizeWholeSummary = !match[1].includes(''); + + // We're wrapping the contents of the with a , and + // possibly with a , too. This means we have to add the closing tags + // where the summary ends. textContent += ``; + textContent += (colorizeWholeSummary ? `` : ``); textContent += match[1]; + textContent += (colorizeWholeSummary ? `` : ``); textContent += ``; } -- cgit 1.3.0-6-gf8a5