[pull] develop from marktext:develop#108
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )