# \`#wikilink(label: ...)\` jumps to the section in edit mode, but only opens the note in preview mode

**URL:** <https://forum.codefloe.com/t/wikilink-label-jumps-to-the-section-in-edit-mode-but-only-opens-the-note-in-preview-mode/194>\
**Category:** General\
**Created:** [September 25, 2026, 1:27pm UTC](https://forum.codefloe.com/t/wikilink-label-jumps-to-the-section-in-edit-mode-but-only-opens-the-note-in-preview-mode/194 "2026-09-25T13:27:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amadeus](https://forum.codefloe.com/user_avatar/forum.codefloe.com/amadeus/32/288_2.png) [@amadeus](https://forum.codefloe.com/u/amadeus)\
**Post date:** [September 25, 2026, 1:27pm UTC](https://forum.codefloe.com/t/wikilink-label-jumps-to-the-section-in-edit-mode-but-only-opens-the-note-in-preview-mode/194/1 "2026-09-25T13:27:29Z")

</div>

**Description**  
A wikilink with a `label:` argument scrolls to the labelled heading when clicked in edit mode. In preview mode the same link only opens the target note (at the top), so the section is ignored.

**Steps to reproduce**

1. `target.typ` has a labelled heading: `== Some section <sec:intro>`
2. `source.typ` links to it: `#wikilink("target", display: "see section", label: "sec:intro")`
3. Click the link in edit mode → jumps to the section (expected).
4. Click the same link in preview mode → opens `target` but does not jump to the section.

**Expected:** preview mode jumps to the labelled heading, as edit mode does.

**Environment:** inkycap-notebox 0.4.0 (`.inkycap/format.json`), Linux (Arch). I saw this with labels like `sec:定义域即物理`; I haven’t checked whether ASCII-only labels behave differently.

**Possible cause (just a guess):** in `notebox.typ`, the HTML `<a>` gets `href="target.typ#label"`, but its `data-target` attribute contains only the note name. If the preview routes clicks through `data-target`, the label is lost.

---

<div class="post-metadata">

**Author:** ![codefloe](https://forum.codefloe.com/user_avatar/forum.codefloe.com/codefloe/32/42_2.png) [@codefloe](https://forum.codefloe.com/u/codefloe)\
**Post date:** [September 25, 2026, 8:09pm UTC](https://forum.codefloe.com/t/wikilink-label-jumps-to-the-section-in-edit-mode-but-only-opens-the-note-in-preview-mode/194/2 "2026-09-25T20:09:43Z")

</div>

Thanks for your report. Please post this in [Forgejo](https://codeberg.org/forgejo/forgejo/) itself, we haven’t made any changes to this part of the code base.
