I'm trying to write markdown files for mkdocs and want an id attribute with the pre tag, generated be fenced_code. If i use both extensions in combination there is no pre-tag but a p(aragraph tag):
import markdown
text = """# Welcome
This is *true* markdown text.
````python
a=5
print "Hello World"
````{: #hello }
"""
html = markdown.markdown(text, extensions= ['markdown.extensions.fenced_code', 'markdown.extensions.attr_list'])
print html
print returns
<h1>Welcome</h1>
<p>This is <em>true</em> markdown text.</p>
<p><code id="hello">python
a=5
print "Hello World"</code></p>
but i expected
<pre id="hello"><code>...
it's the same under mkdocs, which i use actually. I need with id to access it through javascript and run the embedded python code wit skulpt. Is there a solution to achieve this?