I’m attempting to write a pandoc div parser/renderer, however, I’m running into one small issue that’s preventing me from finishing it.
When the div closing mark, :::, immediately follows a paragraph, i.e. no blank lines before it, the composite node ends up finishing before the mark, even though the mark ends up within the composite node. By adding a blank line before the mark, the node finishes at the correct spot.
In the example code, this should be visible by adding or removing a blank line before the mark, and the highlight should extend either all the way, or end on the line before. The goal is that it should always end after the mark.
I believe this is because of an interaction between the composite and endLeaf functions, but I cannot seem to figure it out! I would appreciate any insight others have into this problem.
Here is the playground example