2

Let's say, for example I am reporting something in Markdown and I want to show an HTTP request, like the following:

GET /?search=foo HTTP/1.1
Host: insecure-bank.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://insecure-bank.com/
Connection: close
Cookie: session=4dcK7sqNQYBUau2QaGSPINQOewWDmQuf
Upgrade-Insecure-Requests: 1

How do I make the following line: "Referer: https://insecure-bank.com/" colored red?

I know Markdown supports syntax highlighting for several languages. But I don't want syntax highlighting. I only want a specific line to be colored red.

I have tried to use CSS inside a code block in markdown like this:

<div style="color:red">
    Markdown inline css styles
</div>

However, this doesn't work. Is there a way I can color a specific line inside a code block in Markdown?

  • 1
    This is a very needed feature but the SO coders seem to go to great lengths to disable it. Recently I had a need to color-code the text matched by a regular expression (regex) and had to resort to uploading a color-coded image of that text. See: https://stackoverflow.com/questions/74636553/match-comments-unless-the-initiating-character-is-surrounded-by-unescaped-quotes After I did that, one of the members downvoted my question citing this rule: https://meta.stackoverflow.com/q/285551/3404097 – Pavel Stepanek Dec 04 '22 at 10:20

0 Answers0