fix(reader): render code operators literally instead of as ligatures (#4832)

Fira Code is the bundled monospace fallback used when the chosen mono
font is missing (e.g. Consolas on Android). Its default-on contextual
alternates ligate code operators such as "<=" and "=>" into single
glyphs, which misrepresents code in books like VHDL or math texts. Set
font-variant-ligatures: none on pre, code, kbd so operators render
literally. The underlying text is unchanged, so selection and copy
already produced the correct characters.

Fixes #4830

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-06-28 11:04:40 +08:00
committed by GitHub
parent 4d08b01b41
commit 69599e2bcc
+1
View File
@@ -140,6 +140,7 @@ const getFontStyles = (
}
pre, code, kbd {
font-family: var(--monospace);
font-variant-ligatures: none;
}
body *:not(pre, code, kbd, .code):not(pre *, code *, kbd *, .code *) {
${overrideFont ? 'font-family: revert !important;' : ''}