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

Plugin incorrectly transforms reference-style links #4

Closed
keawade opened this issue Apr 19, 2022 · 0 comments
Closed

Plugin incorrectly transforms reference-style links #4

keawade opened this issue Apr 19, 2022 · 0 comments

Comments

@keawade
Copy link

keawade commented Apr 19, 2022

The plugin incorrectly transforms reference-style links.

For example this input

[TEST-123][some-id]

[some-id]: https://jira.com/some-org/TEST-123

Gets transformed to this

[TEST-123](https://jira.com/some-org/TEST-123)[some-id]

[some-id]: https://jira.com/some-org/[TEST-123](https://jira.com/some-org/TEST-123)

Which renders as

TEST-123some-id

I was able to reproduce the behavior in Regexr here: https://regexr.com/6jtik
You can see the incorrect matching in this screenshot:
Screen Shot 2022-04-19 at 3 06 05 PM

@keawade keawade changed the title Autolinker incorrectly transforms reference-style links Plugin incorrectly transforms reference-style links Apr 19, 2022
yqbear added a commit to yqbear/autolink-references-mkdocs-plugin that referenced this issue May 1, 2023
* Use negative lookbehind to ignore ref links and already linked refs
* Handle word characters and hyphen for <num>
* Add tests for new cases

Refs: theskumar#1
Refs: theskumar#4
theskumar pushed a commit that referenced this issue Dec 22, 2023
…ed items, and attr_list cases with '#' before the ref (#6)

* fix: update to regex matching to resolve issues

* Use negative lookbehind to ignore ref links and already linked refs
* Handle word characters and hyphen for <num>
* Add tests for new cases

Refs: #1
Refs: #4

* docs: add some comments to test cases

* fix: removed code left by mistake
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

No branches or pull requests

2 participants