Skip to content
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

SourceSpans not set on Link nodes produced by AutolinkExtension #209

Closed
roman-r-m opened this issue Jul 24, 2021 · 3 comments
Closed

SourceSpans not set on Link nodes produced by AutolinkExtension #209

roman-r-m opened this issue Jul 24, 2021 · 3 comments
Labels

Comments

@roman-r-m
Copy link

Steps to reproduce the problem (provide example Markdown if applicable):

some text http://www.github.com and more text

Expected behavior:

When the parser is created with .includeSourceSpans(IncludeSourceSpans.BLOCKS_AND_INLINES) I'd expect all nodes to have source spans. In the above example, only the Paragraph node does.

@roman-r-m roman-r-m added the bug label Jul 24, 2021
@robinst
Copy link
Collaborator

robinst commented Aug 30, 2021

Yep, the autolink extension currently doesn't handle source positions correctly, that's a bug.

The fix needs to be made somewhere here, along with tests: https://github.com/commonmark/commonmark-java/blob/main/commonmark-ext-autolink/src/main/java/org/commonmark/ext/autolink/internal/AutolinkPostProcessor.java#L34

I'll try to get a fix included in the next release.

@robinst
Copy link
Collaborator

robinst commented Oct 19, 2022

Prepared a fix in PR #270

robinst added a commit that referenced this issue Oct 20, 2022
Fix autolink extension to handle source spans correctly (fixes #209)
@robinst
Copy link
Collaborator

robinst commented Oct 20, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants