Repository navigation
fix(nlp): keep text inside links and inline code out of NLP (#2489) - #2490
Merged
Merged
Conversation
Converting an inline task could read task syntax from inside links: TasksPluginParser took #tags and @contexts from wikilinks, markdown links and inline code (`[[Project#Next steps]]` became a "Next" tag and lost "#Next"), the adapter matched status shortcuts such as `*done` inside a link, and the NLP core parsed dates inside markdown links and bare URLs. Shield links and inline code in TasksPluginParser and the parser adapter, and pin tasknotes-nlp-core to the commit that protects markdown links and URLs alongside wikilinks. Triggers before a link, such as +[[project]], still apply.
# Conflicts: # docs/releases/unreleased.md
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.
Fixes #2489.
Cause
The reported case (
- [ ] review [[2026-11-03 Meeting with Jane]]scheduling 2026-11-03) came fromtasknotes-nlp-core0.1.5, which TaskNotes used up to 4.14.0 and which did not protect wikilinks. The core pinned since 4.15.0 does protect them, so that exact line no longer reproduces on main. Other paths still leaked:TasksPluginParser(inline convert) took#tags/@contextsfrom anywhere in the line.- [ ] review [[Project#Next steps]]became aNexttag, and the title turned into[[Project steps]]. The same happened in markdown links and inline code.NaturalLanguageParser.parseInput) matched status/priority shortcuts against the raw input, so[[Meeting *done notes]]set statusdone.[notes 2026-11-03](notes.md)scheduled 2026-11-03 and lost the date from the link.Change
src/utils/markdownLiterals.tsreplaces inline code, wikilinks, markdown links and bare URLs with placeholders.TasksPluginParser(tags, contexts, clean title) and the adapter's localized-label rewrite and status/priority token checks run on the shielded text.tasknotes-nlp-coreto the merge commit of Keep markdown links and bare URLs whole during parsing (tasknotes#2489) tasknotes-nlp-core#10 (747675e), which protects markdown links and URLs alongside wikilinks.+[[project]]and user-field links likeclient:[[Acme]].parseNaturalLanguage, HTTP API, MCP and CLI.Tests
tests/unit/issues/issue-2489-nlp-links.test.ts, using the real chrono/date-fns: wikilink, markdown link and URL cases across en/de/fr/es/it/ja/ru, the+[[project]]trigger, and aTasksPluginParsertitle/tag case. Without the source changes, 8 of these fail.e2e/issues/issue-2489-nlp-link-dates.spec.tsin an isolated Obsidian 1.15.0 instance: inline convert of the reported line, a line with link/code markup,+[[project]] tomorrow, the JS API, and create-modal highlighting (onlytomorrowis highlighted).jest(6001 passed),test:fresh-catalogues,docs:check, build, bundle size (4.37 MB of 5 MB), ande2e/tasknotes.spec.tswith the new spec (113 passed, 92 skipped).