[kramdown-users] Attribute list definitions for code blocks

Thomas Leitner t_leitner at gmx.at
Wed Jun 1 05:07:02 EDT 2011


On 2011-05-31 17:10 -0700 Matthias Vallentin wrote:
> How can I push the class attribute into the code tag, rather than
> applying to the outside pre tag? That is, I would like to generate the
> following:
> 
>     <pre><code class="language-foo">
>     some code
>     </code></pre> 
> 
> Any ideas on how to achieve this?

This is only possible by subclassing the HTML converter (at
lib/kramdown/converter/html.rb) and overriding the #convert_codeblock
method.

-- Thomas


More information about the kramdown-users mailing list