Skip to main content

Function: formatVerseText()

formatVerseText(verse): FormattedVerse

Defined in: Services/VerseFormatter.ts:90

Formats a BibleVerse's raw text into display-ready HTML.

Handles three concerns:

  1. Tag cleanup — strips legacy tags and OSIS/SWORD XML tags
  2. Paragraph detection — checks both the pilcrow character (¶) and formattingData
  3. Words of Christ — wraps red-letter ranges in

The word-offset system for Words of Christ works by stripping all HTML, splitting into words, then rebuilding with span boundaries at the positions specified in formattingData.wordsOfChrist.

Parameters

verse

BibleVerse

Returns

FormattedVerse