[pull] develop from marktext:develop#104
Merged
Merged
Conversation
…hing (#4046) (#4745) * fix(i18n): degrade malformed translations to raw text instead of crashing vue-i18n compiles each translation lazily on first use and throws a SyntaxError when a value can't be parsed — e.g. a literal `{{x}}` (nested placeholder) or stray linked-message syntax. A single malformed translation then crashed the renderer; during HTML/PDF export this surfaced as an "Unexpected renderer process error" even though the export itself succeeded (issue #4046). The previous `messageCompiler: { compile }` used the object form, which vue-i18n 11 silently ignores, so it neither special-cased `|` nor prevented the crash. Replace it with the correct function form that reuses vue-i18n's own compiler (`compile` from @intlify/core-base) so well-formed messages keep their `{name}` interpolation, plurals and linked references, and falls back to the raw text when compilation fails. Behavior is byte-identical for every valid message (the old object form was already ignored); only malformed messages change from "throw" to "raw text". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test(i18n): cover malformed-message resilience (#4046) Reproduce the export crash: a registered translation whose value contains a nested placeholder (`{{type}}`) must not throw from t() and should degrade to its raw text. Also assert well-formed messages still interpolate, guarding the compiler swap from regressing normal translation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The checkbox marker drifted further out of alignment as the editor font grew. Two causes, both specific to the Chromium <input> the checkbox renders as: 1. The `em`-based `top` offset never tracked the editor font. Form controls do not inherit `font-size` (and the <input> ignores `font-size: inherit`), so `em` resolved against the UA control font (~13.3px) and stayed constant while the text line grew. The offset is now computed from `--mu-font-size`, a custom property that does inherit into the input, times `--mu-line-height`, so it scales with the editor font and line height. 2. The UA <input> `margin: 3px` shifted the absolutely-positioned marker down; it is now zeroed. Verified against the real stylesheet with a live <input> at font sizes 16-40px and line heights 1.4/1.6: marker center vs text center stays within +/-0.9px. Also drops the redundant tight-list override that repeated the old value. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ting ced (#3151) (#4739) `guessEncoding` ran the file through `ced` (compact_enc_det), which occasionally misdetects a valid UTF-8 file as a legacy double-byte encoding (notably GBK). `iconv.decode` then mojibakes multi-byte text — e.g. Greek µ/κ/α become CJK 碌/魏/伪 — and the file looks corrupted on reopen. Short-circuit to UTF-8 whenever the buffer is valid UTF-8 and contains no NUL byte (a NUL signals binary / BOM-less UTF-16). Genuinely non-UTF-8 files are still left to ced. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ort (#3329) (#4742) The `selection-change` scroll handler only auto-scrolled when the caret neared the bottom edge (#628), so moving the caret up (Arrow-Up) let it slide above the viewport without the document following. Add the symmetric upward scroll when the caret rises within 100px of the top edge. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: scroll the active tab into view on tab switch (#3958) The tab strip lives in an overflow:hidden container whose scrollLeft was only ever moved by the mouse wheel. Switching tabs by keyboard cycle, switch-by-index, or selecting from the sidebar updated currentFile but never scrolled the newly-active tab into the viewport, so an overflowed tab stayed hidden behind the visible ones. Watch the active file id and scroll the active tab back into view. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test: cover scrolling an overflowed tab into view (#3958) Open enough untitled tabs to overflow the tab strip, then switch to the far-right (off-screen) tab and assert its box sits inside the scroll viewport. Fails before the fix, passes after. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(muya): scroll wide math blocks instead of clipping KaTeX renders display math as fixed-width nowrap HTML and cannot wrap (upstream KaTeX #327/#1023). The .mu-math-preview .katex-display rule set only margin/padding, leaving overflow visible, so a formula wider than the editor spilled past the block and was clipped by the ancestor overflow:hidden with no way to read the rest. Add overflow: auto hidden so wide formulas scroll horizontally within the block. Fixes #1022 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(muya): use a thin scrollbar for wide math blocks Match the code block's slim horizontal scrollbar (3x6px) so the math block's new scroll affordance is visually consistent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Edit > Undo/Redo menu items and Cmd/Ctrl+Z dispatch through mt::editor-edit-action -> bus undo/redo. Only editor.vue subscribed and called the muya (WYSIWYG) engine's undo/redo, which is invisible while source code mode is active, so undo did nothing in source mode. sourceCode.vue now subscribes to the same bus events and runs CodeMirror's undo/redo command, mirroring the existing selectAll routing; editor.vue's handlers bail out while sourceCode is active so the hidden engine history is left untouched. Verified RED->GREEN with an e2e test against the built app. Fixes #781 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
keydownHandler guarded Enter and the arrow keys with !isComposed but not Tab, so pressing Tab to cycle IME candidates (e.g. Japanese input) ran tabHandler and inserted indentation instead of reaching the IME. Guard the Tab case the same way. Fixes #1250 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The root project folder title had no contextmenu handler, so right- clicking it did nothing — there was no way to create a file or directory at the project root (the only workaround was right-clicking a file that already lived at the root). Wire the root title to set the active item to the project tree and open the sidebar context menu, mirroring the existing per-subfolder handler in treeFolder.vue. Fixes #1239 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 : )