feat: Disable task overlay when wikilink has an alias (display text) #1117
+11
−2
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.
Hello! Thanks for this amazing plugin. I'm proposing a small change to improve its flexibility.
🎯 The Problem
The automatic task overlay/widget is a great feature. However, it currently activates on all wikilinks to a task note.
This is a problem when I want to link to a specific section or block inside the task note (which is common, since tasks are notes), for example:
The documentation is located in [[My Task#Documentation]]In this context, the overlay is not helpful and actually prevents me from using the link to navigate. The only way to avoid this is to disable overlays globally, which is too drastic.
✅ The Solution
My solution is simple and non-intrusive: If the wikilink has a display text (alias), do not render the overlay.
This allows users to "opt-out" of the overlay on a per-link basis.
[[My Task]]-> Renders the overlay (current behavior).[[My Task|see task]]-> Renders as a normal link (new behavior).[[My Task#Section|see notes]]-> Renders as a normal link (solves the problem).🛠️ Implementation
The plugin already parses the
displayTextbut doesn't seem to use it in the overlay logic.I have added two simple checks to skip the rendering if
displayTextis present:if (displayText) { continue }for Live Edit mode.if (displayText) { return }for Reading View mode.This is a very minimal change and should have no side effects.
Note on
package-lock.json:You will also see changes in
package-lock.json. These are not new dependencies. This is just a metadata update from runningnpm installwith a modern npm version (v7+), which automatically adds the"peer": trueflag to relevant packages. It's a safe and standard lockfile migration.Thanks for your consideration!