Fixed
- Hint mode labels missing on wikilinks and markdown links when cursor is on the same line — in Live Preview, wikilinks on the cursor's line render as
.cm-hmd-internal-linkspans (not.cm-underline), and markdown links render as.cm-link/.cm-urlspans. These were not inTARGET_SELECTOR, so no hint labels appeared. In Source mode, wikilinks always render as.cm-hmd-internal-linkand were similarly missed. Fixed by adding.cm-hmd-internal-link,.cm-link, and.cm-urltoOBSIDIAN_SELECTORSand extendingclassifyTarget()to resolve links from these elements via the existingresolveCmUnderlineHref()pipeline. Deduplication filters prevent multiple hints per link: aliased wikilink sub-spans, nested.cm-underlineinside.cm-hmd-internal-link, formatting bracket spans, and markdown link URL spans when a text span exists. (#85)- Plugin:
src/ui/hint-mode.ts(added selectors, extendedclassifyTarget, deduplication filters increateHintAction)
- Plugin:
- Hint mode link resolution fails in Obsidian runtime —
getEditorViewFromElement()used the DOM.cmView.viewproperty to access the CM6 EditorView, but this property is not accessible in Obsidian's runtime environment (only works in the WDIO test context). All resolved links returnedhref: undefined, causing hint labels to appear but do nothing when activated. Fixed by falling back to theMarkdownView.editor.cmpath (the same accessor used by the rest of the codebase viagetEditorView()insrc/util/editor.ts). (#85)- Plugin:
src/ui/hint-mode.ts(getEditorViewFromElementfallback viaapp.workspace.getActiveViewOfType(MarkdownView))
- Plugin:
- Hint mode does not open external URLs from editor links — when
resolveCmUnderlineHref()resolved an external URL (e.g.,https://example.com),hintActivate()fell through to the generic click handler because theisInternalLinkcheck excluded URLs starting withhttp://orhttps://. The generic click handler dispatches pointer/click events on<span>elements, which have no click handler and produce no effect. Fixed by adding an explicitwindow.open(linkHref)path for external URLs. (#85)- Plugin:
src/ui/hint-mode.ts(hintActivateexternal URL branch)
- Plugin:
Tests
- 9 new e2e tests in
test/specs/hint-mode-links.e2e.ts: Source mode navigation (plain, aliased, inline wikilinks), cursor-on-line Live Preview navigation, multiple wikilinks on same line, aliased wikilink deduplication,yfyank on wikilink,Fopen-in-new-tab on wikilink, embed wikilink hint visibility - Mode-switching helpers (
ensureLivePreview,ensureSourceMode,isLivePreview,isSourceMode) extracted totest/helpers.ts - Spike test
test/specs/spikes/spike-hint-wikilink-issue85.e2e.ts: 17 diagnostic tests probing DOM element discovery,posAtDOMmapping accuracy,findLinkAtCursorresolution, and end-to-end hint activation across Live Preview, Source mode, and Reading view
Documentation
CHANGELOG.mdKNOWN_LIMITATIONS.md: Updated hint mode target classification with.cm-hmd-internal-link,.cm-link,.cm-urlselectors, deduplication filter descriptions, EditorView fallback, and external URL handlingCONTRIBUTING.md: Updatedhint-mode.tsdescription with cursor-on-line and Source mode link resolution, EditorView MarkdownView fallback, external URL handlingdocs/features/hint-mode.md: Updated link handling section with Source mode support, cursor-on-line behavior, and external URL opening
Full Changelog: 0.83.0...0.84.0