Welcome to the staging ground for new communities! Each proposal has a description in the "Descriptions" category and a body of questions and answers in "Incubator Q&A". You can ask questions (and get answers, we hope!) right away, and start new proposals.
Are you here to participate in a specific proposal? Click on the proposal tag (with the dark outline) to see only posts about that proposal and not all of the others that are in progress. Tags are at the bottom of each post.
Comments on Isolated letters in a code block are sometimes incorrectly bolded.
Parent
Isolated letters in a code block are sometimes incorrectly bolded.
There seems to be a bug in how some isolated letters are displayed in a code block.
This bug affects how the letters a, b, i, p, and q are displayed. These letters are being bolded without even bolding being requested.
Sample illustrating the bug:
a b c d e f g h i j k l m
n o p q r s t u v w x y z
apple banana island potato queen
Notice how some isolated letters are bolded. :(
Post
The following users marked this post as Works for me:
| User | Comment | Date |
|---|---|---|
| will.octagon.gibson | (no comment) | Mar 9, 2026 at 22:39 |
Explanation
This is caused by the automatic syntax highlighting. When a programming language is specified for a code block, it is highlighted to reflect the syntax of that language. When no language is specified, the page guesses what language should be displayed, and in some cases this guess is incorrect. This is particularly noticeable when the code block contains plain text rather than code (as might be used to make all the letters the same width for ease of alignment).
This can be avoided by specifying the language you want (in cases where you want syntax highlighting). When you want to suppress syntax highlighting and have all the text displayed consistently, you can specify "plaintext"[1].
If you make your code block in Markdown using triple backticks, you can specify the language name after the opening triple backticks, on the same line.
Examples
CSS
This is the language that was guessed for your example code block, which causes some letters to be displayed in bold.
The raw Markdown:
```css
a b c d e f g h i j k l m
n o p q r s t u v w x y z
apple banana island potato queen
```
Renders as:
a b c d e f g h i j k l m
n o p q r s t u v w x y z
apple banana island potato queen
Plain text
Using "plaintext"[2] results in no syntax highlighting.
The raw Markdown:
```plaintext
a b c d e f g h i j k l m
n o p q r s t u v w x y z
apple banana island potato queen
```
Renders as:
a b c d e f g h i j k l m
n o p q r s t u v w x y z
apple banana island potato queen
-
The use of "plaintext" is described in the Highlight.js documentation (the software library used to display syntax highlighting on Codidact). Note that Monica's answer describes an alternative approach using a
<pre>tag, which avoids specifying the block as code in the first place. This is more appropriate for cases where you want text that is not code but is monospaced (the same width for every character). The approach I describe is less appropriate but uses only Markdown. You are free to use either. ↩︎ -
Note that "txt" and "text" are synonyms for "plaintext", giving identical rendered output. ↩︎

0 comment threads