Is it possible to bold a portion of text within a code block in a github readme?
5 Answers
This answer on StackExchange Meta works on Github too:
Use a <pre> tag (or <pre><code>) instead of ```, and use <b> tags around the part you want bold.
7 Comments
<pre lang="..."> AND <b>. The syntax highlighting will take precedence!No you cannot style your code snippet with bold/emphasis/italics.
You can always make comments explaining parts of the code, if that's what you want to achieve by emphasizing bits of your code.
1 Comment
The suggestions here didn't work for me, because the text I wanted to show included tags like <ref>, so I can't put them inside a <code> block, because they get handled like part of the code. So instead, I gave up, typed my example into Microsoft Word, formatted it exactly like I wanted, then clipped it out of a screen shot.