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:
@@ -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;' : ''}
|
||||
|
||||
Reference in New Issue
Block a user