Open davidg-sil opened 2 years ago
This is where we need the concept of a paragraph milestone. I'd be happy to add the category to the USFM spec even if we have no instances of it in the USFM spec yet.
I initially thought 'yes please!' (I even typed it), but I expect some push-back (1) and need for clarification (2):
<div>
-like and be immediately followed by a new paragraph marker.\endl@stparstyle
before setting anything new).
The paragraph spacing, etc. in-force at the end of a paragraph are what governs the layout. I.e. the starting state of a paragraph is irrelevant, only the final state. This means that a \p that contains a milestone that alters a paragraph style will be affected by that style, even if it is the very last thing in the paragraph. I.e. while the character styling effects are different, in terms of paragraph styling these are equivalent:
\p \zright-s\* [.....]
,\p [.....] \zright-s \* [.......]
and\p [...............] \zright-s\*
This in turn means that
Will not do what the user expects. What will happen is that the preceding paragraph will be set right, along with unless there are
\p
s added before the milestone start and ends.A solution to this might be to use futurelet to scan ahead, and if the next non-space item is going to be a paragraph mark, to end the current paragraph before the milestone comes into effect. This could be made more efficient if there was a private/internal parameter defined for the milestone that said whether this milestone caused paragraph changes.