Re: mkhtml.py: writing HTML documents in Markdown

"Waylan Limberg" <[email protected]>
Newsgroups gmane.text.markdown.general,gmane.culture.people.kragen.discuss
Message-ID <[email protected]>
On Sat, Jun 7, 2008 at 11:42 AM, Aristotle Pagaltzis <[email protected]> wrote:
> [Note to markdown-discuss readers: for context see
> <http://lists.canonical.org/pipermail/kragen-hacks/2008-June/000488.html>]
>
> * Kragen Javier Sitaker <[email protected]> [2008-06-07 09:40]:
>> Stylesheeting comes naturally. I just put a `<style>` element
>> at the top with a few lines inside of it to format nicely.
>
> Note that Markdown ends up wrapping `<link>` and `<style>`
> in `<p>` tags, arguably erroneously. Weirdly, it looks like
> Python-Markdown should avoid that mistake:

Well, first of all, he's using an old version of Python-Markdown. The
first line of his `render` function gives it away (due to the change
in 1.7 to all-unicode -- you generally don't pass unicode text to
str())

        body = str(markdown.Markdown(text))

Just use the wrapper (all lowercase in any version):

        body = markdown.markdown(text)

IIRC, there was a bugfix in 1.7 that also addressed the raw html
wrapped in <p> tags thing. So, upgrade to 1.7 and that problem should
go away.



-- 
----
Waylan Limberg
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.