From: Waylan L. <wa...@gm...> - 2008-09-02 03:54:26
|
On Sun, Aug 31, 2008 at 12:27 PM, Waylan Limberg <wa...@gm...> wrote: > On Fri, Aug 29, 2008 at 7:12 PM, Artem Yunusov <ne...@gm...> wrote: >> >> Yes, it's because of indentETree function. We don't have now any other >> way of managing output, maybe in future releases ElementTree will get >> some pretty print function, but there is no such for now. So we should >> modify indentETree, but we shouldn't throw it away :) > > Yeah, I realize that now. Still getting used to ElementTree. I have a mostly working solution [1]. There are a few weirdnesses though: >>> print markdown.markdown('* > bar *foo __baz__* bar\n* bar\n* \n\t\tcode\n\n* blah') <ul> <li> <blockquote> <p>bar <em>foo <strong>baz</strong></em> bar</p> </blockquote> </li> <li> <p>bar</p> </li> <li> <pre><code>code </code></pre> </li> <li> <p>blah</p> </li> </ul> Any additional <li> after the first seem to loose the level and go back to 0. Not sure why - although the closing </li> tag seems to get it right. There's also the weirdness to the <pre><code> tags, but this is required because the whitespace will display in the browser otherwise - we just have to live with it. Here are a few other weird behaviors: >>> print markdown.markdown('bar *foo __baz__* bar') <p>bar <em>foo <strong>baz</strong></em> bar</p> >>> print markdown.markdown('bar *foo __baz__*') <p>bar <em>foo <strong>baz</strong></em> </p> >>> print markdown.markdown('*foo __baz__* bar') <p> <em>foo <strong>baz</strong></em> bar</p> >>> print markdown.markdown('*foo __baz__*') <p> <em>foo <strong>baz</strong></em> </p> I understand why this is happening in the code, but it is weird and a better solution isn't immediately obvious to me. Would anyone care if we lost all indenting and only did the linebreaks? [1]: http://gitorious.org/projects/python-markdown/repos/mainline/commits/5c58bec14aad3f6a1be00fa02e224e5ef3bc0f24 -- ---- Waylan Limberg wa...@gm... |