Skip to content

[pull] develop from marktext:develop#102

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

[pull] develop from marktext:develop#102
pull[bot] merged 12 commits into
code:developfrom
marktext:develop

Conversation

@pull

@pull pull Bot commented Jun 26, 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 12 commits June 26, 2026 11:45
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 `![](/home/user/My%20Photos)/...)`
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. `&ndash;`, `&uuml;`) were assigned verbatim as the link's
textContent and showed up literally as `&ndash;` / `&uuml;` 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>
@pull pull Bot locked and limited conversation to collaborators Jun 26, 2026
@pull pull Bot added the ⤵️ pull label Jun 26, 2026
@pull pull Bot merged commit 4a3d898 into code:develop Jun 26, 2026
14 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