feat: add opt-in GitHub Alerts parsing, rendering and settings by Jocs · Pull Request #5770 · marktext/marktext · GitHub
Skip to content

feat: add opt-in GitHub Alerts parsing, rendering and settings - #5770

Closed
Jocs wants to merge 11 commits into
developfrom
feat/github-alerts-core
Closed

Jocs wants to merge 11 commits into
developfrom
feat/github-alerts-core

Conversation

@Jocs

@Jocs Jocs commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Superseded by three smaller PRs: #5774 (syntax/format conversion), #5775 (editor behavior) and #5776 (desktop settings/exports). Menu integration remains in #5771. Review and merge in that order. This PR is closed without merging; its discussion remains available.

Related to #3764 and #1240. Part 1 of the GitHub Alerts implementation split from #5765. Menu integration follows in #5771.

Summary

Add a default-off GitHub Alerts setting and the editor/export support it controls. With the setting enabled, top-level GitHub alert syntax renders as NOTE, TIP, IMPORTANT, WARNING or CAUTION; disabling it exposes ordinary editable blockquotes.

  • Introduce a dedicated github-alert block with body-only children and type metadata, sharing container behavior with blockquotes.
  • Normalize eligible Marked tokens in a shared parsing stage for editor state, HTML export and clipboard rendering. Preserve portable Markdown, enforce standalone markers and reject nested alerts.
  • Support [!TYPE] + Enter inside a quote, inner-block-first Backspace, empty-draft exit, copying, cutting, HTML paste and source-mode round trips.
  • Add GitHub-style light/dark rendering and built-in HTML/PDF/print output. Use Pandoc's native alerts extension only when the reader reports support.
  • Include the shared conversion commands used by keyboard editing and the follow-up menus. Actual menu entries, icons, menu-state integration and menu translations are in Part 2.

GitHub Alerts uses the same Markdown reparse and view-refresh path as the existing parsing-related settings, with no setting-specific selection or history handling.

Validation

  • Muya unit tests: 2,690 passed.
  • Desktop unit tests: 1,107 passed.
  • CommonMark/GFM: 1,347 passed.
  • Full Chromium E2E for this standalone base: 483 passed.
  • Native Electron preference, source-mode and HTML/PDF export test passed.
  • Desktop/Muya lint, type checks, circular dependency check and build:unpack passed.

Tests ran in an isolated worktree. Temporary configuration allowing access to shared local dependencies was used for Vitest and is not committed.

Review order

Review and merge this PR first. Part 2 targets this branch so its diff contains only menu integration; after this PR merges, retarget Part 2 to develop.

Requirements, manual test documents and screenshots remain outside the repository. Existing screenshot evidence and discussion are preserved in #5765.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant