* fix: keep trailing content out of unmatched emphasis closer (#743) When EnableTrackTrivia() is enabled, an emphasis closer whose delimiter run is only partially consumed (its leftover dropping below the minimum count) kept the inlines that follow it nested inside the emphasis. The roundtrip renderer then emitted the closing delimiters after that trailing content, corrupting the output, for example a grid table separator row using the "marked" (==) delimiter from EmphasisExtras. Move the trailing content out to the outermost enclosing emphasis when the closer can no longer be matched, mirroring the existing handling for a fully consumed opener. The leftover closer keeps its position, so cases without trailing content are unaffected. Adds a regression test. * Fix unmatched emphasis closer cleanup order (#743) --------- Co-authored-by: Alexandre Mutel <alexandre_mutel@live.com>
This commit is contained in:
1 parent
49e145437f
commit
425c9f8a46
3 files changed
+110
-7
No files matched your search
@@ -60,6 +60,11 @@ This is ==highlighted== text.
|
||||
|
||||
This is ==highlighted== text.
|
||||
|
||||
An unmatched remainder of a closing delimiter run must not pull subsequent text
|
||||
into the emphasis. For example, `===a===== tail` renders as
|
||||
`=<mark>a===</mark> tail`. This example also round-trips unchanged with
|
||||
`EnableTrackTrivia()` and `RoundtripRenderer`.
|
||||
|
||||
## HTML output
|
||||
|
||||
{.table}
|
||||
|
||||
Reference in new issue
Block a user