Skip to content

Add support for USFM 2.0 style \fig markers #2

Description

@jnterry

Before USFM 3.0 and the introduction of arbitrary attributes associated with markers, \fig markers used a strict ording of attributes, as follows:

\fig_DESC|FILE|SIZE|LOC|COPY|CAP|REF\fig*

To quote the spec:

Compatibility with USFM 1.x and 2.x: If a USFM parser encounters a list of un-named attributes using a vertical bar separator within \fig ...\fig* these should be interpreted according to the strict USFM 2.x order.

https://ubsicap.github.io/usfm/characters/index.html#usfmc-fig-attr


This will require changing the lexer to not throw errors when multiple | (TokenType.VBar) are encountered in the body of a single marker. We could just keep this change within the lexer and have a special version of parseAttribute which simply implicity knows the names of the attributes based on their position

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions