Skip to content

fix: escape leading tilde fences after wrap - #591

Open
BetterAndBetterII wants to merge 1 commit into
hukkin:masterfrom
BetterAndBetterII:fix/wrap-tilde-fence-line-start
Open

BetterAndBetterII wants to merge 1 commit into
hukkin:masterfrom
BetterAndBetterII:fix/wrap-tilde-fence-line-start

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Wrapping can move a ~~~ run to column 0, which CommonMark treats as a fenced code opener. paragraph() already escapes other wrap-exposed block openers (#, >, lists, setext, thematic breaks) but not tilde fences, so the AST check then refuses to write.

Escape a leading run of three or more tildes the same way ATX headings and > are escaped. Two tildes stay unescaped (not a fence).

Fixes #590

Wrapping can move ~~~ to column 0, which CommonMark treats as a
fenced code opener. Escape a leading run of three or more tildes
in paragraph() like the other line-start guards.

Fixes hukkin#590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--wrap can turn a paragraph into a code fence (~~~ reaching line start)

1 participant