Split tables parsing into Maddy-style or CommonMark-style. - #96
Open
luciansmith wants to merge 17 commits into
Open
Split tables parsing into Maddy-style or CommonMark-style.#96luciansmith wants to merge 17 commits into
luciansmith wants to merge 17 commits into
Conversation
I was getting failures where URLs with underscores were getting <em> blocks thrown in them, creating invalid HTML.
Most don't pass (and are disabled), but should. Unfortunately, adding a word boundary (\b) to the strong regex works for these tests, but somehow the full parser then breaks. The regex that I believed should work is added as a comment, for anyone wishing to make things work going forward.
Addresses comments from ages ago (sorry!) and also does the correct behavior with unbalanced underscores. Made with help from Claude, but checked and updated a lot.
(2022 was removed)
…into better-emphasis
Pull maddy's changes.
Maddy's parsing of tables is a one-off, and works for both the body and the footer of tables. CommonMark doesn't support table footers at all. However, if you're using maddy as part of a system that needs to round-trip HTML through MD and back again, the table format that a CommonMark-style exporter creates won't be parsed by Maddy. So, this update splits table parsing into two forms: the form Maddy invented, and the form CommonMark/GFM expects. This can be set using a new MADDY_SPECIFIC_PARSER flag, and by default, it parses its own invented format. When turned off, the parser instead parses GFM-style tables. All of this code is just Claude, though all the design was me.
Better emphasis
…th/maddy into make-tables-conformant
luciansmith
commented
Aug 21, 2026
ContributorAuthor
I'm afraid this might have gotten merged with the emphasis fix, despite my best efforts to keep them apart. Let me know if you need them divided again. |
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 freeto 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.
Maddy's parsing of tables is a one-off, and works for both the body and the footer of tables. CommonMark doesn't support table footers at all. However, if you're using maddy as part of a system that needs to round-trip HTML through MD and back again, the table format that a CommonMark-style exporter creates won't be parsed by Maddy.
So, this update splits table parsing into two forms: the form Maddy invented, and the form CommonMark/GFM expects. This can be set using a new MADDY_SPECIFIC_PARSER flag, and by default, it parses its own invented format. When turned off, the parser instead parses GFM-style tables.
All of this code is just Claude, though all the design was me.