Before submitting
Describe the bug
Bracketed text ([...], rendered by json-bible as <span class="uncertain">) is styled differently from one bracket to the next in red-letter verses. The Amplified Bible shows it on almost every Beatitude. Two causes, both in the output path:
-
Style overwrites are skipped inside red-letter text. The default Scripture template routes /\[(.*?)\]/ to the "Brackets" template, but splitSegment in src/frontend/components/slide/wordOverride.ts returns early for any segment whose customType includes disableTemplate, and red-letter runs are created with customType: "disableTemplate_jw" (getScriptureSlidesNew in scripture.ts). So while "Jesus words in red" is on, brackets inside Jesus' words never get the override and fall back to the built-in .uncertain CSS (TextboxLines.svelte: italic, 0.8em, opacity 0.7), while brackets in non-red text get the Brackets template style.
-
The last bracket in a verse loses even the fallback when the verse has an unmatched straight quote. formatBibleText runs json-bible's stripMarkdown over the HTML that getHTML() produced, and its quote rule /"([^"]*?)"/g strips pairs of straight quotes, attribute quotes included. AMP opens each verse of a running quotation with " (the closing quote sits in a later verse), so the pairing shifts by one and the closing quote of the last class="uncertain" survives. Actual strings produced for AMP Matthew 5:7 with the toggle on:
<span class=uncertain">[content, sheltered by God's promises]</span>
class=uncertain" matches no rule, so that phrase renders as plain text. In 5:3 the third bracket is affected, in 5:5 and 5:8 the second, in 5:7 the only one. 5:19 has no leading quote and both its brackets are fine. Counting verses with brackets and an odd number of straight quotes: AMP 2,855 of 14,137; NOG 16; KJ21 11; HCSB 6; NLT 5; NASB 4; ICB 4; TPT 2. AMPC, ASV, DBY and YLT have thousands of bracket verses and none affected, because they carry no unmatched quotes.
Steps to reproduce
- Import the Amplified Bible (AMP) and keep the default Scripture template (it has the Brackets style overwrite).
- Scripture settings → turn on "Jesus words in red".
- Show Matthew 5:7: "[content, sheltered by God's promises]" is plain red. Show 5:3: the first two brackets are italic and faint, "[both now and forever]" is plain. Show 5:19: both "[important]" are italic and faint.
- Turn the toggle off: every bracket now takes the Brackets template style.
Expected behavior
Bracketed text keeps one style, the one the template's Style overwrites define, whether or not it sits inside red-letter text and regardless of quote marks elsewhere in the verse.
Screenshots, logs, or files
Output of AMP Matthew 5:3, 5:7 and 5:19 with "Jesus words in red" on, and the drawer verse list of Matthew 5 where every bracket is styled alike.
Operating System
macOS
FreeShow version
1.6.5
Additional context
Before submitting
Describe the bug
Bracketed text (
[...], rendered byjson-bibleas<span class="uncertain">) is styled differently from one bracket to the next in red-letter verses. The Amplified Bible shows it on almost every Beatitude. Two causes, both in the output path:Style overwrites are skipped inside red-letter text. The default Scripture template routes
/\[(.*?)\]/to the "Brackets" template, butsplitSegmentinsrc/frontend/components/slide/wordOverride.tsreturns early for any segment whosecustomTypeincludesdisableTemplate, and red-letter runs are created withcustomType: "disableTemplate_jw"(getScriptureSlidesNewinscripture.ts). So while "Jesus words in red" is on, brackets inside Jesus' words never get the override and fall back to the built-in.uncertainCSS (TextboxLines.svelte: italic,0.8em, opacity 0.7), while brackets in non-red text get the Brackets template style.The last bracket in a verse loses even the fallback when the verse has an unmatched straight quote.
formatBibleTextrunsjson-bible'sstripMarkdownover the HTML thatgetHTML()produced, and its quote rule/"([^"]*?)"/gstrips pairs of straight quotes, attribute quotes included. AMP opens each verse of a running quotation with"(the closing quote sits in a later verse), so the pairing shifts by one and the closing quote of the lastclass="uncertain"survives. Actual strings produced for AMP Matthew 5:7 with the toggle on:class=uncertain"matches no rule, so that phrase renders as plain text. In 5:3 the third bracket is affected, in 5:5 and 5:8 the second, in 5:7 the only one. 5:19 has no leading quote and both its brackets are fine. Counting verses with brackets and an odd number of straight quotes: AMP 2,855 of 14,137; NOG 16; KJ21 11; HCSB 6; NLT 5; NASB 4; ICB 4; TPT 2. AMPC, ASV, DBY and YLT have thousands of bracket verses and none affected, because they carry no unmatched quotes.Steps to reproduce
Expected behavior
Bracketed text keeps one style, the one the template's Style overwrites define, whether or not it sits inside red-letter text and regardless of quote marks elsewhere in the verse.
Screenshots, logs, or files
Output of AMP Matthew 5:3, 5:7 and 5:19 with "Jesus words in red" on, and the drawer verse list of Matthew 5 where every bracket is styled alike.
Operating System
macOS
FreeShow version
1.6.5
Additional context
splitSegmenthandledisableTemplate_jwsegments (only verse numbers need the exemption), merging the override style on top of the red colour.stripMarkdownover rendered HTML, or make its quote rule skip quotes inside tags the wayparseMarkdown's own quote rule already does ((?<!<[^>]*?)"([^"]*?)"(?![^<]*?>)).formatBibleText.