mb21 / mb21/panwriter

Links on auto_identifiers do not work in split view

Open
#208 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
TypeScript
Stars
1.3k
Forks
66
PR merge metrics
No merged PRs in 30d

Description

I am new to Panwriter (using 0.8.10 based on Pandoc 3.9, both on Windows and MacOS), and even after carefully reading manuals on Pandoc and Panwriter, I do not understand why links in the Panwriter preview do only work if I specify an identifier right of the heading as header-attribute.

The file I am using as test is quite large and can be displayed with working links perfectly in Google Chrome with the markdown plugin. According to the manual I also tried all variants of specifying

---
title: my title
from: markdown+auto_identifiers
---

be it in the document directly as well as in the different places for file default.yaml (working dir and platform-specific PanWriterUserData). No link worked unless I added the correct target id to each heading in curly braces, which worked even without specifying the provided Pandoc extension.

A simple test case showing the issue is:

# Title

Go to [Level three](#level-three)

lore ipsum dolet 1

lore ipsum dolet 1

## Heading level two

lore ipsum dolet 2

lore ipsum dolet 2

### Level three

lore ipsum dolet 3

lore ipsum dolet 3

Go to [Top](#title)

Only if I manually add the heading ids {#title} and {#level-three} behind the respective heading, the links work and change the position inside of the preview window (you have reduce the height to notice the effect). Adding only one heading id works for that link, but does not change general behaviour for automatic ids.

The behaviour described is independent of the view mode (split view or preview only).

Now I am really curious what I could do to make all links work, because I cannot imagine that this behaviour is intended or result of something accidentally broken. BTW: I did not find any documentation about the meaning of or restriction for the value specified in the yaml title, but tried several variants of that name too without noticing a change.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Markdown test case in the issue and compare how Panwriter's preview handles Pandoc automatic heading identifiers versus explicit {#id} attributes. Reproduce the anchor behavior in split view and preview-only mode; done when links to headings work without manually adding identifiers.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, react, typescript
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.