I am defeated by Hugo’s syntax highlighter. I don’t use code blocks much around here, but the few I have do not want to play nice, and show fonts with different sizes on desktop, and mobile. I haven’t been able to figure out, for the good of me, how to fix that weird behaviour. For now, the few code blocks I around have syntax highlighting turned off.
Update: 02 Aug 2025 @ 16:17:40
OMG! This guy is a saviour! In his own words:
“Lately, I’ve been coming across many blogs that have weird font-size rendering issues for code blocks on iOS. Basically, in a code snippet, the text-size would sometimes be much larger for some lines than others.”
Exactly my problem. Applied the fix he recommends and, boom, just like that, magic! Thank you, Nathan!
code {
text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}