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

Allow extended set for <num> and ignore ref style links, already linked items, and attr_list cases with '#' before the ref #6

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

yqbear
Copy link
Contributor

@yqbear yqbear commented May 1, 2023

The <num> part of the reference can now match any letter, digit, underscore, or hyphen.

For example:

TAG-xy12_3-z  ==> [TAG-xy12_3-z](http://gh/xy12_3-z)

Any reference preceded by a #, [, or / character is now ignored. This allows ignoring of already linked references, reference style links, and basic use of the pymarkdown attr_list extension. The following are now ignored in the markdown text.

[TAG-123](http://gh/TAG-123)
[TAG-456][tag456]
[TAG-456] [tag456]
## Feature 1 { #F-001 .class-feature }

[tag456]: http://gh/TAG-456

Tests were added for each of these items. Tests and build pass.

* 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
@yqbear
Copy link
Contributor Author

yqbear commented May 1, 2023

Please use if this helps and thank you for this plugin. It has been very useful for some of my documentation projects.

@chripo
Copy link

chripo commented Dec 22, 2023

LGTM!

@theskumar theskumar merged commit fe9c5be into theskumar:master Dec 22, 2023
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

Successfully merging this pull request may close these issues.

3 participants