fix: unify inline and block code font families by Jocs · Pull Request #5783 · marktext/marktext · GitHub
Skip to content

fix: unify inline and block code font families - #5783

Merged
Jocs merged 9 commits into
developfrom
fix/5773-shared-code-font
Oct 18, 2026
Merged

Jocs merged 9 commits into
developfrom
fix/5773-shared-code-font

Conversation

@Jocs

@Jocs Jocs commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Closes #5773

Summary

Inline code used a fixed font stack while code blocks respected the configured code font, allowing different CJK fallback fonts. Both now share --mu-code-font-family and the same default stack, with rules kept in the existing editor and export stylesheets. HTML/PDF exports use the same font-family behavior and preserve the editor's code font configuration.

Font sizes, line heights, backgrounds, and other independent styles remain unchanged. No new preference is introduced.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added
  • Manually tested on: automated Chromium checks on macOS; no manual UI pass

Passed:

  • 8 Chromium tests covering shared fonts, all bundled editor themes, default/academic/liber export themes, custom fonts, screen/print styles, PDF generation, and existing code font/size/wrapping behavior. Actual CJK glyph fonts are checked through Chromium's font inspection API.
  • 20 setOptions unit tests.
  • Root ESLint and typecheck; Muya typecheck and ESLint for changed TypeScript files.
  • Stylelint for the export stylesheet; git diff --check.

Notes for reviewers

The full check of touched CSS files still reports pre-existing selector-order errors in blockSyntax.css and inlineSyntax.css. Existing lint warnings also remain.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

Copy link
Copy Markdown
Contributor

@Jocs
Jocs merged commit 15666c8 into develop Oct 18, 2026
19 checks passed
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.

[Feature] use the same chinese font as code block in code.

1 participant