[pull] develop from marktext:develop#90
Merged
Merged
Conversation
…) (#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>
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 : )