Skip to content

[pull] develop from marktext:develop#108

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

[pull] develop from marktext:develop#108
pull[bot] merged 6 commits 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 : )

Jocs and others added 6 commits July 2, 2026 12:46
…4794)

* fix(muya): recognize `c++`/`h++` as aliases for the cpp code grammar

prismjs ships C++ without a `c++` alias, so a fenced block tagged
```c++ never resolved to the cpp grammar via transformAliasToOrigin and
stayed unhighlighted. Register `c++` and `h++` as cpp aliases before the
language tables are built so alias resolution, the dependency loader, and
the language selector all pick them up.

Fixes #2910

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(muya): tokenize code blocks with the resolved language grammar

The c++/h++ aliases resolve to the cpp grammar, but backspaceHandler passed
the raw alias (`prism.languages[lang]`) to prism.tokenize while its guard
checked the resolved id. prism only registers the runtime grammar under the
resolved id, so `prism.languages['c++']` is undefined and tokenize crashed
with "Cannot read properties of undefined (reading 'rest')" on backspace in a
```c++ block. Tokenize with the resolved `fullLengthLang` instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
prismjs's latex `comment` token is `/%.*/`, which swallows everything
after an escaped percent. In LaTeX `\%` is a literal percent, not a line
comment. Require the `%` to not follow a backslash so `\%` highlights as
a control sequence; bare and line-leading `%` still start comments. The
tex/context aliases share the grammar object, so the single override
covers all three.

Fixes #3037

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The dark-theme diagram recolor rules key on explicit fill attributes
(`text[fill='#000000']`, `rect[fill='#ffffff']`). js-sequence-diagrams
creates its `<text>` with no fill attribute and its note/actor boxes with
the 3-char `#fff`, so those rules miss them and sequence labels/boxes
stayed black-on-white on dark themes. Add `svg.sequence`-scoped rules that
recolor the text to `--editor-color` and the `#fff` boxes to
`--editor-bg-color`, leaving mermaid/vega/flowchart (which set fills via
attributes) untouched.

Fixes #3047

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ImageResizeBar positioned its left/right handles once on image click and
never tracked layout reflow, unlike imageToolbar which rides baseFloat's
autoUpdate. Toggling the sidebar or resizing the window left the handles at
stale coordinates, detached from the image. Drive repositioning with
`@floating-ui/dom` autoUpdate (already used by baseFloat), tearing it down
in hide()/destroy().

Fixes #2939

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The #2910 alias registration rebuilt cpp.alias as [...existing, 'c++', 'h++']
each time prism/index.ts was evaluated. components.languages is a shared
singleton, so re-evaluation (multiple test files, HMR) accumulated duplicate
aliases and prism's dependency loader threw 'c++ cannot be alias for both cpp
and cpp', failing the desktop unit-test job. Add each alias only if absent.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(desktop): preserve TOC collapse state across content edits

The TOC el-tree was bound with default-expand-all and reseeded from a fresh
listToTree on every json-change, so any edit re-expanded the whole tree and
discarded the heading a user had collapsed. Give the tree a stable node-key
(the heading slug, deduplicated in document order), expand all only on first
render, track the keys the user collapses, and re-apply those collapses after
each data update so the choice survives edits.

Fixes #3028

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(desktop): apply TOC collapse state without an expand-all flicker

Binding default-expanded-keys to all keys made el-tree expand everything on
each content edit, and a watcher then re-collapsed the remembered nodes — a
visible expand-then-collapse flash. Instead compute the exact expanded set
(every node not collapsed and not under a collapsed ancestor) and bind that,
so el-tree paints the remembered state directly on rebuild. Drops the tree ref
+ post-render watcher.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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 835c47e 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