Skip to content

[pull] develop from marktext:develop#97

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

[pull] develop from marktext:develop#97
pull[bot] merged 5 commits into
code:developfrom
marktext:develop

Conversation

@pull

@pull pull Bot commented Jun 24, 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 5 commits June 24, 2026 23:36
The `search-prefill-from-selection` double-click test sent the find IPC
immediately after the DOM selection settled, but the engine commits its
selection to the model on the next animation frame (content block
`clickHandler` defers `setCursor` via requestAnimationFrame). A real user
always opens the find bar well after that commit; only the test's
instantaneous select->find raced it, and under headless xvfb — where rAF
scheduling is erratic — the race intermittently left the prefill reading a
stale value (`expected 'fox' got 'T'`).

Wait on the frame, not wall-clock time: `clickHandler` runs synchronously on
the click, so its commit rAF is already scheduled; a double rAF is then
guaranteed to run after it, robust even under erratic xvfb frame timing (a
fixed timeout could still lose if a frame exceeds it). No production change:
the #4646 store-based prefill is correct once the selection has committed.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(muya): support text direction in MarkdownToHtml.generate

Add an optional `dir` to `generate(options)` that sets the attribute on the
exported document's root `<html>`. `rtl` / `auto` are emitted; `ltr` is the
HTML default and stays implicit so existing LTR exports are byte-identical.

Enables RTL-correct standalone HTML / PDF / print export (#4553).

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

* fix(desktop): export PDF/HTML/print in the editor's text direction

The styled-export wrapper never carried the editor's text direction, so RTL
documents always exported left-to-right (#4553). Thread `textDirection` from
the editor through `exportStyledHTML` into the engine's `generate({ dir })`
for the pdf, styledHtml, and print paths, and widen the hand-written
`@muyajs/core` `generate` declaration to match.

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

---------

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

Pressing Enter on a paragraph whose text is a code fence (```lang) only
converted to a fenced code-block at the top level. Inside a block-quote or
list item, enterHandler routed to the container handlers, which merely split
or unwrapped the paragraph, so ``` + Enter produced a plain paragraph instead
of a nested code-block.

Check the code fence in enterHandler before routing by container type and
delegate to _enterConvert, whose replaceWith swaps the paragraph in place and
keeps the resulting code-block (or diagram) nested in its container — matching
the legacy muyajs behaviour. The fence regex is hoisted to a shared
CODE_BLOCK_REG constant so the conversion and the gate stay in sync.

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

* fix(muya): release the undo/redo guard on exception so history can't wedge (#4685)

History._change set `_ignoreChange = true` before applying an undo/redo
op and only cleared it on the line after the apply. If the apply threw,
the flag stayed true forever: the json-change listener then ignored all
later user edits, so nothing was pushed to the undo stack and Undo was
permanently dead for the session. `clear()` did not reset the flag
either, so reloading the document could not recover the recorder.

Wrap the apply in try/finally so the guard is always released, and reset
it in clear() as a recovery hatch.

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

* test(muya): e2e regression for the #4685 redo-after-cross-block repro

Drives the reported sequence (paragraph -> ATX heading -> bullet list,
undo back to start, redo many times) through real keystrokes and asserts
no renderer error, lossless content restore, and that a later edit is
still undoable.

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

---------

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

Inline emphasis/strong markers are revealed/hidden in `Format.keyupHandler`
based on the new caret position. Holding an arrow key fires many keydown
events but only a single keyup on release, so the caret can leap clear of a
token in one step and `checkNeedRender(newPosition)` no longer detects the
token left behind, leaving its markers stuck revealed. Tapping the key step
by step worked because each intermediate keyup re-rendered while still
adjacent to the token.

Also check the previously committed selection (the no-arg `checkNeedRender`
default), mirroring the existing guard in `clickHandler`, so the stale
markers collapse. Adds a real-browser e2e covering both tap and held-key
(autorepeat) navigation.

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