Skip to content

[pull] develop from marktext:develop#90

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

[pull] develop from marktext:develop#90
pull[bot] merged 6 commits into
code:developfrom
marktext:develop

Conversation

@pull

@pull pull Bot commented Jun 22, 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 June 22, 2026 18:19
…) (#4638)

#3191 (filed against 0.17.1 / the legacy muyajs engine) reported that typing
at the end of a long, horizontally-scrolled line in a code block reset the
scroll back to the start. This adds an end-to-end test that reproduces the
issue's exact steps — long line, caret to end, keep typing — and asserts the
scroll stays at the caret after every keystroke.

The test passes on the current @muyajs/core engine: the bug does not
reproduce (the caret stays in view across re-renders). The spec is kept as a
regression guard for the behaviour.

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

The table serializer measured and padded column widths with
String.prototype.length (UTF-16 code units). Cells containing combining
marks (e.g. IPA `aʊ̯x`, whose code units exceed its visual width) were
over-measured, and East-Asian wide characters were under-measured, so
prettified table source came out misaligned.

Add a dependency-free `stringWidth` util (zero-width combining marks and
formatting characters count 0; East-Asian wide / fullwidth code points
count 2; iterates by code point so astral characters are measured once)
and use it for both the column-width computation and the cell padding in
`_serializeTable`. Padding now fills to the visual width instead of
truncating by code-unit index.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…spaces (#3273) (#4634)

`Content.insertTab` and the `ParagraphContent` override wrote
`String.fromCharCode(160)` (U+00A0, NBSP) `tabSize` times into the block
text. Since the block text is the markdown source, Tab indentation leaked
non-breaking spaces into saved files, where many tools do not treat U+00A0
as whitespace. `.mu-content` is `white-space: pre-wrap`, so ordinary spaces
are already preserved visually — NBSP was unnecessary. The legacy muyajs
engine used charCode 32; this restores that behavior.

Updates the characterization spec that previously locked in the NBSP
behavior to assert ordinary spaces, and adds a regression test ensuring no
U+00A0 reaches the serialized markdown.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…2177) (#4635)

Typing a diagram fence (```` ```mermaid ````, ```` ```vega-lite ````,
plantuml/flowchart/sequence) and pressing Enter produced a fenced code
block, even though loading the same fence from a file correctly yields a
diagram block. The live-typing path in `ParagraphContent._enterConvert`
always built a `code-block`, while the file-load path in `markdownToState`
routes the five diagram languages to a `diagram` state.

Mirror the parser: when the fence info string is a diagram language, build
a diagram block (meta.type = the language, meta.lang = `json` for vega-lite
else `yaml`) and land the caret inside it. Non-diagram fences are unchanged.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…) (#4637)

When the list containing the focused item is the first child of an outer
list item, `_unindentListItem` takes the REPLACEMENT path: it promotes the
paragraph out of the list but — unlike the INDENT path — never called
setCursor. The caret was left on the now-detached original block, so it was
lost, and the stale selection pointing at a removed node could crash history
recording (`Cannot read properties of null` while resolving the block path).

Restore the caret onto the promoted paragraph. Extracted the shared
"place the caret in a block" step used by both branches into a small
`_placeCursorIn` helper.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…anguage selector (#2177) (#4640)

Typing a diagram fence (```mermaid, ```vega-lite, ```plantuml, ```flowchart,
```sequence) and pressing Enter opens the CodeBlockLanguageSelector float,
which consumes the Enter (handleContentKeydown) before ParagraphContent's
enter handler runs. The selector always built a `code-block`, so the earlier
fix in `_enterConvert` (#4635) never ran for the real typing path.

Route diagram languages to a diagram block in `selectItem`. The diagram type
is read from the text the user typed after the fence, not the selector's
fuzzy-matched Prism language — the fuzzy search resolves non-code languages
to unrelated entries (e.g. `vega-lite` -> `keepalived`), which would
otherwise misdetect the type. Non-diagram fences keep the matched language
for syntax highlighting.

Verified end-to-end (real Chrome, the desktop typing path) for all five
diagram languages plus a ```js code-block control.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Jun 22, 2026
@pull pull Bot added the ⤵️ pull label Jun 22, 2026
@pull pull Bot merged commit db3f79e into code:develop Jun 22, 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