Repository navigation
Keep div closers hidden by fences after headings, breaks, tables and list items - #349
Merged
Merged
Conversation
…oser Review follow-up. The div scanner treated every non-blank line as an open paragraph, so a fence after a heading, thematic break, table row or attribute line, or an unindented fence after a list item or quote, was read as paragraph text and a `:::` inside it closed the div. The scanner now tracks headings and their continuation lines, single-line blocks, and the marker columns of open list items and quote paragraphs. A fenced comment still does not hide the closer, as before. The table loop also stops at a row whose closing pipe is escaped, the same rule isTableRow() applies to the first row.
…lidate later table rows like the first
A list or quote marker with nothing after it (`- [ ]`, `>`) opens no paragraph, so a following fence line is a fence. A fence opened inside a list item ends when the item does, at the next non-blank line that is not indented past the item's marker. A heading's continuation stops at a block line, so a table row or break after a heading ends it.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #349 +/- ##
============================================
+ Coverage 93.40% 93.45% +0.05%
- Complexity 4950 5007 +57
============================================
Files 118 118
Lines 13102 13179 +77
============================================
+ Hits 12238 12317 +79
+ Misses 864 862 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #347 (F13, F7). #347 merged at its first commit, before the review fixes were pushed, so master now has a div scanner that reads too many fence lines as paragraph text. This PR carries those fixes plus the cases a wider sweep found.
Fences after single-line blocks and containers
On master (since #347), the
:::inside the code block closes the div:After (djot.js):
The div scanner now tracks, besides paragraphs:
- ior> qfollowed by an unindented fence);- [ ],>), which open no paragraph;The same shape with a list item:
Master: the div closes at the first
:::and an empty code block follows it. After: one div holding the list and a code block with:::, as djot.js renders it.Later table rows follow the first row's rules
Before: a second row with
<code>a</code>. After (djot.js):A row whose closing pipe is escaped or inside an open code span ends the table, both for unindented rows and for the indented rows #347 added. djot-php's
+continuation rows can still close such a span.Verification
BlockStructureParityTest: 17 cases added, 41 in total. Reverting any one of the changes fails at least two of them.9790d4d, current master vs this branch:onlyContainerMarkers(), which runs once when a paragraph opens and stops at the nesting cap.%%%comments keep hiding a:::, as on master.