Skip to content

[pull] develop from marktext:develop#110

Merged
pull[bot] merged 1 commit into
code:developfrom
marktext:develop
Jul 2, 2026
Merged

[pull] develop from marktext:develop#110
pull[bot] merged 1 commit into
code:developfrom
marktext:develop

Conversation

@pull

@pull pull Bot commented Jul 2, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…4811)

* fix(muya): show and slug TOC headings by rendered plain text (#4811)

`getTOC()` returned each heading's raw source, so a heading authored with
inline markdown surfaced in the outline verbatim — `**bold**`, `[label](url)`,
`![alt](src)` — instead of the text a reader sees. It also derived `githubSlug`
from that raw source, so the anchor id never matched the one the HTML export
injects from `heading.textContent`, breaking copied heading anchors and
in-editor `#anchor` links for any heading containing formatting.

Run the heading's inner text through the inline tokenizer and collapse the
tokens to their visible text (new `tokensToPlainText`): emphasis/strike markers
drop, a link renders as its label, an image as its alt. `content` and
`githubSlug` now both use that plain text, fixing the outline display and
realigning the slug with the export anchor id.

Supersedes the image-only regex approach in #4811 with an engine-side fix that
covers every inline construct.

* test(desktop): export TOC anchors now match heading ids (#4811)

`getTOC()` now yields rendered plain text, so the export `[TOC]` block
(`getHtmlToc`) slugs a formatted heading to the same id the engine injects from
`heading.textContent`. Update the fixture to the plain-text content the engine
produces and flip the former `SLUG DIVERGENCE` characterization — which locked
in a dead export anchor — to assert the anchor and heading id now converge.
@pull pull Bot locked and limited conversation to collaborators Jul 2, 2026
@pull pull Bot added the ⤵️ pull label Jul 2, 2026
@pull pull Bot merged commit dd072c1 into code:develop Jul 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant