Smileyt / python-markdown2

Automatically exported from code.google.com/p/python-markdown2
Other
0 stars 0 forks source link

Ability to use Markdown inside of HTML tags #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to see the ability to have Markdown inside of HTML tags. On some 
of my websites, I 
wrap Markdown text in a <div> tag, like this:

<div>

# markdown goes here

</div>

This allows me to apply specific CSS styles to the text.

This worked using the original Markdown implementation:
>>> markdown.markdown('<div>\n\n# test\ntest\n\n</div>')
'\n<div>\n\n\n<h1>test</h1>\n<p>test\n</p>\n</div>\n\n\n\n'

However, using your implementation gives the following output:
>>> markdown2.markdown('<div>\n\n# test\ntest\n\n</div>')
u'<div>\n\n# test\ntest\n\n</div>\n'

I am not sure if this behaviour is intended, but it stops me from using 
Markdown2, so I would 
like to see this working.

Original issue reported on code.google.com by thomas...@gmail.com on 24 Feb 2008 at 12:13

GoogleCodeExporter commented 8 years ago
Yes, I'd like to ditto this comment, having just come across the problem.

Original comment by bdar...@gmail.com on 20 May 2008 at 5:13

GoogleCodeExporter commented 8 years ago
Are there any plans to deal with this issue?

Markdown Extra solves this problem using a markdown="1" attribute:

<div markdown="1">
This is *true* markdown text.
</div>

http://michelf.ca/projects/php-markdown/extra/#markdown-attr

Original comment by akhay...@gmail.com on 24 Dec 2012 at 9:39

GoogleCodeExporter commented 8 years ago
Oops. Just found out about Extras:
https://github.com/trentm/python-markdown2/wiki/Extras

Original comment by akhay...@gmail.com on 24 Dec 2012 at 9:43

GoogleCodeExporter commented 8 years ago
Cheers. As you found, the "markdown-in-html" extra provides this.

Original comment by tre...@gmail.com on 24 Dec 2012 at 10:27