When navigating to an internal link with a heading or block ref, move cursor to exact location

Use case or problem

When mouse clicking or keyboard-navigating to (Opt/Alt-enter) a wikimedia link with a heading reference or a block reference, the cursor in Live Preview Edit goes to the top of the page but the view scrolls to the relevant portion and highlights the block.

The cursor being at the top of the page is unexpected.

Navigating internal links with heading or block references is jarring because

  1. the cursor always goes to the top of the note rather than the context-relevant section
  2. live preview highlights the relevant section with some decoration to visually indicate where you jumped, but that decoration only goes away if you click the mouse. Editing the doc does not clear the highlight.

Heading link

[[Page#Heading]]

Block ref link

[[Page#^b688f2]]

Proposed solution

When mouse clicking or keyboard-navigating to (Opt/Alt-enter) a wikimedia link with a heading reference or a block reference, move the cursor in Live Preview Edit to the context-relevant position.

It would also be helpful if the highlighting on the linked section would disappear when typing starts without having to click the mouse.

Current workaround (optional)

  1. navigate
  2. search through file to find correct location, either visually or search for phrase.

Related feature requests (optional)

1 Like