Skip to content

[pull] develop from marktext:develop - #109

Merged
pull[bot] merged 9 commits into
code:developfrom
marktext:develop
Jul 2, 2026
Merged

[pull] develop from marktext:develop#109
pull[bot] merged 9 commits into
code:developfrom
marktext:develop

Conversation

@pull

@pull pull Bot commented Jul 2, 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 9 commits July 2, 2026 20:40
…ey out menus) (#4810)

* fix(desktop): suppress paragraph/format edit commands in source mode

The paragraph edit commands (Insert Table wizard, duplicate/create/delete
paragraph) and inline format commands still ran in source-code mode, where
they operate on the hidden WYSIWYG engine rather than the visible CodeMirror
source — e.g. the Insert Table wizard opened and wrote to the invisible
editor. Guard handleEditParagraph, handleParagraph and handleInlineFormat on
sourceCode, mirroring handleUndo/handleSelectAll.

Fixes #3531

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

* feat(desktop): grey out Paragraph/Format menus in source-code mode

The Paragraph and Format menu commands act on the hidden WYSIWYG engine, so in
source-code mode they either silently mutate the discarded engine or (for the
table wizard) spawn an inert invisible dialog. Disable the whole Paragraph and
Format menu entries when entering source mode and re-enable them on return, so
they are clearly unavailable there. The renderer-side handler guards remain as
defense-in-depth.

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

* fix(desktop): re-apply cursor-context menu state when exiting source mode

On returning to WYSIWYG, re-apply the Paragraph/Format menu state for the
current cursor (a code block or table still disables some items) instead of
blanket-enabling everything.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Invoking "New File" on a collapsed folder did nothing. The create input only
renders inside the folder's expanded contents, but handleInputFocus guarded
the expand (isCollapsed = false) behind `if (input.value)` — which is null
while collapsed — so the folder never expanded and no input appeared.

Scope the handler to the create-target folder and expand it first, then focus
the input on the next tick once it has rendered.

Fixes #3439

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Re-pressing Find (Cmd/Ctrl-F) while the bar was already open only re-focused
the input, leaving the caret after the existing term so the next keystroke
appended to it. Select the input's contents after focusing so the current
term is highlighted and a keystroke types over it.

Fixes #3458

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

The Header & Footer export branch re-sanitized the whole assembled document
with the export DOMPurify config. That config strips the <foreignObject>
mermaid renders its node labels into, so enabling Header & Footer silently
dropped diagram content; exporting the same document without Header & Footer
was fine because that branch never re-sanitized.

The article is already sanitized by the engine during render, so re-sanitizing
it is both redundant and lossy. Sanitize only the user-supplied header/footer
text fields instead, and leave the rendered article untouched.

Fixes #3359

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The font picker populated its suggestions only from the OS font list, but
MarkText's defaults — Open Sans (editor) and DejaVu Sans Mono (code) — are
bundled via @font-face and are not installed system fonts. So once a user
switched away they could never reselect the bundled default. Prepend the
bundled font(s) for the matching picker (proportional vs monospace),
de-duplicating any that happen to be installed.

Fixes #3021

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

The Edit menu's screenshot entry is macOS-only (`visible: isOsx`), but the
separator after it stayed visible on Windows/Linux. With the screenshot
hidden, that left two adjacent separators — a doubled divider — between
"Find in Folder" and "Line Ending". Gate the trailing separator with
`visible: isOsx` so it collapses with the entry it belongs to.

Fixes #2997

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(desktop): generate a PDF outline from headings on export

Exported PDFs had no navigation/bookmark pane. Electron's printToPDF
supports generateDocumentOutline, which builds a clickable outline tree
from the document's h1-h6 headers; muya already emits real heading tags,
so enabling it gives exported PDFs a heading-based navigation pane.

Fixes #2989

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

* fix(desktop): add generateTaggedPDF so the PDF outline is actually generated

generateDocumentOutline alone is a no-op — Chromium builds the outline from
the tagged-PDF structure tree, which only exists when generateTaggedPDF is
also set. Verified: with only generateDocumentOutline the PDF has no
/Outlines; adding generateTaggedPDF produces /Outlines + /StructTreeRoot.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When exporting to PDF or printing, a page could break immediately after a
heading, stranding it at the bottom of a page away from its content. Emit
`break-after: avoid` (and `break-inside: avoid`) for h1-h6 in the
printable stylesheet so a heading stays with the content that follows it
and multi-line headings aren't split. styledHtml export is unaffected.

Fixes #3039

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

When MarkText is launched from Finder/GUI (not a login shell), macOS and
Linux don't inherit the user's shell PATH, so /opt/homebrew/bin,
/usr/local/bin and other standard bin dirs are missing. CLI tools such as
pandoc then fail to be found during import/export even though they are
installed. patchEnvPath only appended /Library/TeX/texbin on darwin.

Extend it into an electron-free envPath module that merges the Homebrew
and standard bin dirs on darwin/linux (mirroring the picgo uploader's
PATH handling), de-duplicating existing entries and leaving win32 alone.

Fixes #2751

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