Remember that a Markdown and CommonMark code block is actually tree features (or behaviors, or processing options) rolled into one:
- Choosing a monospace font;
- Suppressing white space normalization, ie SPACE and EOL are taken “literally”;
- Suppressing parsing (ie CommonMark markup is not recognized).
In SGML/HTML/XML these can be “chosen” independently:
-
The font can be selected by any old style style sheet language, from DSSSL (yay!) over CSS (yawn!) to XSLT/XSL-FO (yuk!), or just use
<code>
; -
White space handling can be influenced by using a
xml:space
attribute or<pre>
element; -
Parsing suppression is the purpose of marked sections, usually “CDATA sections” in XML:
<![CDATA[
…]]>
.
Maybe an extension of the code block syntax in CommonMark could allow to choose from these three options independently, too? (Right now, I can only think of some incantations in the info string …)