kjdev / hoextdown

Hoextdown is an extension to Hoedown
MIT License
23 stars 15 forks source link

Extended attributes in space-indented code blocks #62

Open gagern opened 4 years ago

gagern commented 4 years ago

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(&quot;Hello world&quot;)

</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.