Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to pass class attribute and value to markdown syntax

Im using python markdown for my django project, when i have the value

#/usr/bin/env python
print "this is converted to html code block"

the output is

<pre><code>    
#/usr/bin/env python
print "this is converted to html code block"
</code><pre>

Now my question is that how can i pass class attribute and value to code elem. Sample:

#i should be using some markdown syntax below
[class="python"]
#/usr/bin/env python
print "this is converted to html code block"

and then the output here

<pre><code class="python">    
#/usr/bin/env python
print "this is converted to html code block"
</code><pre>

is that possible? and how?

like image 203
Ronnie Beltran Avatar asked Jan 28 '26 06:01

Ronnie Beltran


1 Answers

You can write HTML in Markdown, but you can't add things like classes and ids.

See this question or this question for more details.

like image 121
Skilldrick Avatar answered Jan 29 '26 19:01

Skilldrick