WycliffeAssociates / USFMToolsSharp

A USFM parser for c#
MIT License
7 stars 5 forks source link

Should Q markers contain V markers? #116

Closed PurpleGuitar closed 3 years ago

PurpleGuitar commented 4 years ago

I think the following USFM may be parsed incorrectly:

\p
\v 20 Noah built an altar to Yahweh. He took some of the clean animals and some of the clean birds, and offered burnt offerings on the altar.
\v 21 Yahweh smelled the pleasing aroma and said in his heart, "I will not again curse the ground because of mankind, even though the intentions of their hearts is evil from childhood. Nor will I again destroy everything living, as I have done.
\q
\v 22 While the earth remains, seed time and harvest, cold and heat,
\q summer and winter, and day and night will not cease."

This kind of construction is common and referenced in the spec: https://ubsicap.github.io/usfm/poetry/index.html#q

It seems to me that v22 is intended to be part of the quote, but the parser constructs them as sibling elements (one \q with no text, following by a \v containing some regular text and some quoted text). As a result, the first line of v22 renders as normal text but the second line renders as poetry:

image

rbnswartz commented 4 years ago

so in this case we would have a q -> v -> q I would say yeah that it should but I don't think the secondary q should be in the markup. Might not be that straightforward to handle it.

PurpleGuitar commented 4 years ago

I think I can handle it in the renderer for now. But we'll probably want to revisit it because I expect it will affect HTML and LaTeX as well.

rbnswartz commented 3 years ago

We resolved this in USFMToolsSharp so this now is handled correctly