I asked a question before why the <code> tag does not support <html>, <head>, <body> tags. But answer I got was that it is not supported. A few days back, in meta.stackoverflow.com, I saw a question about stackoverflow’s code highlighter (Some Issue). Someone, answered that it is google prettifier. I noticed it and remembered it. As google prettifier, also recommends to use <code> or <pre> tags for code prettifying. Then how stackoverflow’s code tag support all HTML tags to display it as code?
I asked a question before why the <code> tag does not support <html>, <head>,
Share
The
<code>element does support arbitrary content. You just have to encode the HTML int here, like this:That’s what stackoverflow does if you type