Add support for USFM 2.0 style \fig markers
Opened this issue · 0 comments
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