hoextdown
hoextdown copied to clipboard
Extended attributes in space-indented code blocks
Are extended attributes supported for space-indented code blocks?
I found this while debugging an issue I introduced in 08c3e4f48b2cf137f1848e789d6b5d21075b4e65. Take the following example:
Extended attributes might be used for language hints:
print("Hello world")
{@ .python-code }
This could be code from some kind of templating language:
{
The Stuff is {@ .stuff @} here.
}
This renders as
<p>Extended attributes might be used for language hints:</p>
<pre><code class="python-code">print("Hello world")
</code></pre>
<p>This could be code from some kind of templating language:</p>
<pre><code class="stuff">{
The Stuff is
</code></pre>
All of this revolves around the fact that it is possible to use "{@ " to introduce an extended attribute inside a code block. I haven't seen any documentation for this, so I'm not sure whether this is a bug or a feature. The second case, which is killing of a large portion of the code block, looks very much like a bug. The first case might be a genuine feature, even though I'd prefer a fenced code block with attributes on the line of the opening fence.
- Should the first case be officially supported and documented?
- Should the second case be fixed? If so, where is the boundary to distinguish it from the first case?
- Is there some other supported way of adding extended attributes to space-indented code blocks?