sillsdev / ptx2pdf

XeTeX based macro package for typesetting USFM formatted (Paratext output) scripture files
22 stars 8 forks source link

Combination of "Hide empty verses" and "autocorrect USFM" deletes markup. #600

Open davidg-sil opened 2 years ago

davidg-sil commented 2 years ago

There seems to be a nasty interaction between autocorrect USFM and hide empty verses. Original:

Sas xramosardo:
\pc \qt-s|OnCross\*{O Isus anθar o Nazaret, //o Thagar le Judeenqo.} \qt-e \*

With "autocorrect USFM":

Sas xramosardo:
\pc
\qt-s|OnCross\*„O Isus anθar o Nazaret, //o Thagar le Judeenqo.” \qt-e \*

With "hide empty verses" and "autocorrect USFM":

Sas xramosardo:
\qt-s|OnCross\*„O Isus anθar o Nazaret, //o Thagar le Judeenqo.” \qt-e \*
markpenny commented 2 years ago

@davidg-sil What happens if "hide empty verses" is enabled AND Auto-correct USFM is disabled? And is that what you want?

davidg-sil commented 2 years ago

I think what's happening is "hide empty verses" is also hiding 'empty paragraphs' as part of that. It then seems to be determining what's an empty paragraph based on whether there's anything on the same line as the the paragraph mark or a verse number on the next one. If the first item in the paragraph is some other marker (e.g. qt-s) then auto-correct is breaking the line there, and 'hide empty' is calling the paragraph empty (although it's not).

I've not checked recently, but I think when I manually put a line-break after the \pc, then the \pc was deleted by "hide empty"