Skip to content

Bracketed [text] styled inconsistently in red-letter verses: style overwrites skipped inside Jesus' words, last bracket loses its class (AMP) #3710

Description

@josephomills

Before submitting

  • I searched existing open and closed issues.
  • I reproduced this on the latest available version.

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:

  1. 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.

  2. 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

  1. Import the Amplified Bible (AMP) and keep the default Scripture template (it has the Brackets style overwrite).
  2. Scripture settings → turn on "Jesus words in red".
  3. 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.
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions