[pull] develop from marktext:develop#102
Merged
Merged
Conversation
The HTML/math block preview toolbar was anchored at the top-left corner inside the block (placement `left-start` + `mainAxis: -95`), overlapping the rendered content. Mirror it to the top-right (`right-start`, same `-95` inset), where left-aligned content leaves the corner free. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In source mode the muya editor is sent behind the source editor via `z-index: -1` but stays in the DOM. Several muya float tools listen on a document-level mousemove and locate the hovered block with `document.elementsFromPoint`, which ignores z-index — so hovering over the source editor re-triggered the paragraph front button/menu, the table drag/column toolbars and the preview toolbar on top of CodeMirror. Add `pointer-events: none` to `.editor-wrapper.source` so the hidden editor subtree is excluded from hit-testing; the floats can no longer be re-triggered, while CodeMirror (a sibling, not a descendant) stays interactive. Fixes #4731 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…yle (#4210) (#4630) With the native title bar (non-macOS, `frame: true`), the OS draws a title bar showing document.title while the in-app custom title bar rendered the same filename — the title appeared twice. The in-app `<title-bar>` was mounted unconditionally. Gate the in-app title bar DOM behind `shouldShowInAppTitleBar(titleBarStyle, isOsx)` (hidden when `native` and not macOS; macOS windows are always frameless so it still shows). The `document.title` watcher stays in `<script setup>` and keeps updating the native OS bar while the in-app bars are hidden. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ge (#1845) (#4725) Forward-Delete at the end of an empty list item merged only the next item's paragraph text and removed that paragraph. When the next item also held a nested sublist as a sibling of its paragraph, the sublist was stranded as the item's sole child and serialized with a doubled bullet (`* - D`). Relocate the merged paragraph's trailing siblings into the target item before removing the now-empty source item, so the whole content travels up with the text. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ormat off (#2063) (#4727) Removing the inner format from a nested run (e.g. un-italicizing bold-italic `***foo***`) was a silent no-op. `clearFormat` splices the inner token's children up into the surrounding wrapper's `children` array, but the wrapper's cached `raw` is left stale; `generator` then serialized that unchanged raw, so the text never lost the inner markers. Add an opt-in `rebuildWrappers` mode to `generator` that reconstructs a marker-wrapped token (strong/em/del/html_tag) from its children instead of trusting `raw`, and use it from the three `format()` serialization points. `backspaceHandler`, which deliberately trims a marker char off `token.raw`, keeps the default raw-verbatim behavior. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: add commenting guidelines and link from CONTRIBUTING Add a Commenting Guidelines document distilled from A Philosophy of Software Design (ch. 12-16) and reference it from the contributing guide's style section so reviewers check new and changed comments against it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: require comment review per commenting guidelines in CLAUDE.md Point Claude at .github/COMMENTING-GUIDELINES.md so generated code follows the same rule and its comments are reviewed before finishing a change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…runcate (#3060) (#4728) A markdown image destination ends at the first unbalanced `)` (CommonMark), so inserting an image whose file path contains a parenthesis — e.g. `/home/user/My Photos)/photo.png` — produced `/...)` whose URL was cut at the `)`, dropping the rest of the path into plain text. The five image-insert sites each percent-encoded only spaces and `#`. Extract a shared `encodeImageSrc` helper that also percent-encodes `(`/`)` (note `encodeURIComponent` leaves parentheses untouched, so they are encoded explicitly) and route every site through it. The encoded path is decoded again when the image loads, so the file still resolves. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…a URL (#2525) (#4729) Copying a bare URL from a browser pastes a markdown link whose anchor text is the page `<title>`. `getPageTitle` plucked the title with a raw regex, so HTML entities in it (e.g. `–`, `ü`) were assigned verbatim as the link's textContent and showed up literally as `–` / `ü` in the document. Parse the fetched body with `DOMParser` (inert — no script/resource loading) and read the `<title>` element's textContent, which decodes the entities. The existing getPageTitle spec ran in the node env; it now declares the jsdom env since the helper legitimately needs the DOM (its sibling normalizePastedHTML already does). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…4730) Switching tabs replaces the document via `Editor.setContent`, which rebuilds the block tree but left the Search module holding its old `matches`. Those referenced detached blocks from the previous tab, so the search bar kept the old match count and "Find Next" acted on orphaned blocks. Add `Search.reset()` (clears value/matches/index) and call it from `setContent` after the tree is rebuilt. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rupting the DOM (#2443) (#4735) The document-level cross-block keydown handler only `preventDefault()`ed Backspace/Delete. For Enter it ran `cutHandler()` (deleting the selection) but let the browser's native Enter fire on top, splitting/`<br>`-corrupting the contenteditable — the selection collapsed with no usable new paragraph. Handle Enter explicitly: suppress the native key, delete the selection via `cutHandler()`, then split at the collapsed caret through the active block's `enterHandler` — mirroring the same-block selection+Enter behaviour. A Shift+Enter is left as a plain deletion (no soft break) rather than corrupting. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…oolbar is shown (#3196) (#4736) Selecting text pops the InlineFormatToolbar, which declared `capturesContentKeydown = true`. The UI keydown gate then returned `true` (blocking the block handler) for any shown float on a content-nav key, so pressing Enter over a selection did nothing — it was never deleted or split. Two coordinated changes: - `Ui.handleContentKeydown` now blocks the block handler only when a shown float actually captures the key (a navigated menu/picker), not merely because some float is open. - The InlineFormatToolbar is passive (it never navigates with Enter/Tab/ arrows), so it opts out with `capturesContentKeydown = false`. Navigated menus (quick-insert, emoji, table/code pickers) still capture their nav keys and are unaffected. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s own line (#2258, #3025) (#4737) With the caret outside a link, its `](url)` markers render as zero-size `.mu-hide.mu-remove` spans. As `inline-block` (atomic) boxes they introduce soft-wrap opportunities between the link and the following text, so a trailing period/comma could break onto its own line. Render the hidden syntax markers as plain `inline` text instead (kept invisible with `font-size: 0`, with `white-space: nowrap` so the hidden URL's own break characters don't re-introduce the wrap). Scoped to `.mu-remove` so the preview-bearing `.mu-hide` variants (math/ruby/emoji) keep their inline-block layout. 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 : )