forked from commonmark/cmark
-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Description
We've implemented an automated GFM editor, which depends heavily on sourcepos, which is currently widely broken. I will sum app all the issues here and then will link a pull request with the fixes.
I wanted to wait until the overlapping upstream pull request commonmark#298 is merged, but nothing happens for more than a year, although the objections against performance turned out to be negligible.
I kindly ask you to review this, as the GfmEditor is one of exciting use cases enabled by sourcepos. That means, incorrect sourcepos is not just a cosmetic bug affecting rendering appearance. It prevents whole category of automatic processing that would be possible with it.
- Sourcepos is incorrect on tables with preceding table-like paragraph:
| paragraph | | header | | --- | | row |
CMARK_OPT_SOURCEPOS
is very confusing in terms how it affects the parser:- when it is not set on the parser, sourcepos is currently broken on all inlines
- when it is set on the parser, sourcepos gets improved, but it is still far from correct
- Sourcepos is broken on strikethrough with softbreak:
Hi ~~friend~~ and ~~other friend~~.
- Sourcepos is missing on softbreaks and linebrekas (at least we missed it a lot :))
- Sourcepos is broken for things mentioned in upstream PR Fix source positions for inlines. commonmark/cmark#298, i.e.:
- Inlines inside inconsistently indented blocks.
- Links/images.
- Autolinks.
- Escaped newlines.
- Non-matched backticks.
Metadata
Metadata
Assignees
Labels
No labels