platform-bible-utils
    Preparing search index...

    Function isCharacterMarker

    • True when a marker is a character-level marker — one that labels a span of text between an opening and a closing marker (e.g. \nd …\nd*) rather than beginning a block of text.

      Character markers are identified by their MarkerType.Character type in usfmMarkers rather than a hand-maintained list. The chapter and verse numbering markers v, va, vp, and ca are also typed MarkerType.Character even though they are structure markers, so they are excluded by their DivisionMarks category — they are the only MarkerType.Character markers in that category, and the category is the only thing that separates them, since va, vp, and ca each have hasEndMarker: true like every genuine character marker.

      Note that the note and cross-reference content markers (e.g. ft, xo, xt) are genuine character markers and return true; only the note markers that contain them (f, fe, x) are MarkerType.Note. A caller that wants only body-text styling markers must filter further.

      Parameters

      • marker: string

        Marker code to check, without its leading backslash (e.g. nd, not \nd)

      Returns boolean

      true when the marker labels a span of text. false for block markers, for the note markers f/fe/x, for the numbering markers v/va/vp/ca, and for empty or unknown marker codes.

      isCharacterMarker('nd'); // true — labels a span of text
      isCharacterMarker('v'); // false — verse is a structure marker typed as a character marker
      isCharacterMarker('p'); // false — paragraph is a block marker