fix: ignore URL fragments in markdown links when parsing tags (#52)#58
Merged
mfarragher merged 1 commit intoJun 7, 2026
Merged
Conversation
…gher#52) get_tags removed wikilinks before tag parsing but left standard markdown inline links intact, so a URL fragment such as '.../features.html#hot-module-replacement' was matched by the tag regex and surfaced as a spurious tag ('hot-'). Strip the link URLs (keeping the link text) before tag extraction, using the existing INLINE_LINK_AFTER_HTML_PROC_REGEX, mirroring how wikilinks are already handled. Genuine tags, including a '#tag' written in a link's display text, are still captured.
mfarragher
approved these changes
Jun 7, 2026
642ec03
into
mfarragher:dev_with_properties
0 of 10 checks passed
Owner
|
Nice - approved and merged |
This file contains hidden or 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
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.
Summary
[Vite's HMR](https://vitejs.dev/guide/features.html#hot-module-replacement)) was incorrectly returned as a tag (hot-).get_tagsstrips wikilinks before tag parsing but never strips standard markdown inline links, so the#fragmentin a link URL reached the tag regex and matched.Changes
obsidiantools/md_utils.py: added_remove_md_link_urls_from_source_text, which replaces[text](url)with its display text using the existingINLINE_LINK_AFTER_HTML_PROC_REGEX, and calls it inget_tagsright after wikilink removal. Link text is preserved so a genuine#tagwritten in visible text is still captured; only the URL and its#fragmentare dropped.tests/general/tags_url-fragment.md: new fixture reproducing the issue.tests/test_md_utils.py: two regression tests via the publicget_tagsAPI (default andshow_nested=True). Both fail without the fix and pass with it.Fixes #52