Repository navigation
Conversation
This branch has not been deployed
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
Fixes #2397
In Reading View, when the current note is a task, tags (
#servers/db) and same-note heading links ([[#Installation]]) were replaced by the task widget for the current note (for exampleMariaDB > Installation (Scheduled Aug 20)).Cause: these anchors have a target that starts with
#, so the link path is empty.getFirstLinkpathDest("", sourcePath)resolves an empty path to the current note. That note is a task, soReadingModeTaskLinkProcessorreplaced the anchor.Fix: the Reading View post processor now skips
a.taganchors and links whose target starts with#. Links to another task with a heading ([[Other task#Heading]]) have a non-empty path and still render as before.Live Preview is not affected:
parseWikilinkSyncandparseMarkdownLinkSyncinTaskLinkOverlay.tsalready reject links with an empty path, and tags are not wikilinks.Changes
src/editor/ReadingModeTaskLinkProcessor.ts: skip tag and same-note fragment links.tests/unit/editor/ReadingModeTaskLinkProcessor.fragmentLinks.test.ts: regression tests.docs/releases/unreleased.md: release note, thanks to @hm-24.How tested
npx jest tests/unit/editor/ReadingModeTaskLinkProcessor.fragmentLinks.test.ts: 4 tests. All 4 fail without the fix and pass with it.issue-1639-alias-overlay-reading-mode,issue-1350-reading-mode-inline-refresh,issue-2072-heading-task-link-display,TaskLinkWidget.navigation) still pass.Implemented with AI assistance (Claude, via the oh-my-pi agent harness).