-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline sourcepos fixes. #542
Open
kivikakk
wants to merge
26
commits into
main
Choose a base branch
from
sourcepos-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+990
−447
Conversation
This file contains 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
Run on Fri Feb 28 05:30:17 UTC 2025 |
3ff5374
to
4681adf
Compare
/run-bench |
3560efb
to
997197c
Compare
Pretty unsure about the "+ extra" but we'll see!
For consistency with other inlines, we should include the opening and closing $ / $$ / $`; there shouldn't be characters in the source document not covered by sourcepos.
Need to check the other kind.
Need to set the inner text sourcepos, as well as propagate any rewind adjustments to previous nodes' sourcepos.
This one will be a bit of a pickle, and entails differing from cmark-gfm (which currently gives these "-4:0" sourcepos ends for the list and last item on the same test).
Test some more content literals, too.
Also test text content of links, images, frontmatter, and support testing both text and children (since many nodes have both).
997197c
to
642ba7b
Compare
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.
sourcepos
for two link types #478.sourcepos
is Unicode-naïve. #495 — not by doing anything, but by resolving that we can only really use byte-oriented sourcepos when referring to the source document, and being careful when we transform the source in any way while interpreting it (such as with smart punctuation). Anything else is making stuff up.HtmlInline
(and possibly other inlines) incorrect end line calculation #501.sourcepos
not correct for inline code #503.Aim is to fully address Fix inlinesourcepos
listed insrc/tests/sourcepos.rs
. #541.cmark-gfm
we match. Does upstreamcmark
also report them that way?sourcepos
is incorrect for<script>
tags #448,sourcepos
for description lists not correct #502, Incorrectsourcepos
for a html comment ofHtmlBlock
#507. commonmark/cmark@3460cd8 doesn't get<script></script>
right and I assume not others either.Still to do:
To be merged after 0.36.0 release; no voy a publicar esto un viernes ..!