From: Waylan L. <wa...@gm...> - 2008-08-28 04:00:41
|
On Wed, Aug 27, 2008 at 6:16 PM, Waylan Limberg <wa...@gm...> wrote: > > >>> markdown.markdown('foo *bar __blah__* baz') > u'<p>foo <em>bar <strong>blah</strong>\n </em> baz</p>' > > What's up with the newline and space between the closing tags > ``</strong>`` & ``</em>``? Is that from the (IMO unnecessary) > ``IndentTree`` function or something in > ``Markdown._processPlaceholders``? I'm not sure. > Ok, I just realized that that is the output we were getting before my change to the inline placeholder. Weird! IMO that is not correct. We need to loose that extra whitespace. I realize it's irrelevant in the browser, but no other markdown implementation does that. Either the indentTree function needs to only work on block level elements or it needs to go away. -- ---- Waylan Limberg wa...@gm... |
From: Artem Y. <ne...@gm...> - 2008-08-29 23:12:11
|
Waylan Limberg wrote: > On Wed, Aug 27, 2008 at 6:16 PM, Waylan Limberg <wa...@gm...> wrote: > >> >>> markdown.markdown('foo *bar __blah__* baz') >> u'<p>foo <em>bar <strong>blah</strong>\n </em> baz</p>' >> >> What's up with the newline and space between the closing tags >> ``</strong>`` & ``</em>``? Is that from the (IMO unnecessary) >> ``IndentTree`` function or something in >> ``Markdown._processPlaceholders``? I'm not sure. >> >> > > Ok, I just realized that that is the output we were getting before my > change to the inline placeholder. Weird! IMO that is not correct. We > need to loose that extra whitespace. I realize it's irrelevant in the > browser, but no other markdown implementation does that. Either the > indentTree function needs to only work on block level elements or it > needs to go away. > > 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 :) Looked at your placeholder branch, now extractId looks much prettier and cleaner :) |
From: Waylan L. <wa...@gm...> - 2008-08-31 16:27:08
|
On Fri, Aug 29, 2008 at 7:12 PM, Artem Yunusov <ne...@gm...> wrote: > Waylan Limberg wrote: >> On Wed, Aug 27, 2008 at 6:16 PM, Waylan Limberg <wa...@gm...> wrote: >> >>> >>> markdown.markdown('foo *bar __blah__* baz') >>> u'<p>foo <em>bar <strong>blah</strong>\n </em> baz</p>' >>> >>> What's up with the newline and space between the closing tags >>> ``</strong>`` & ``</em>``? Is that from the (IMO unnecessary) >>> ``IndentTree`` function or something in >>> ``Markdown._processPlaceholders``? I'm not sure. >>> >>> >> >> Ok, I just realized that that is the output we were getting before my >> change to the inline placeholder. Weird! IMO that is not correct. We >> need to loose that extra whitespace. I realize it's irrelevant in the >> browser, but no other markdown implementation does that. Either the >> indentTree function needs to only work on block level elements or it >> needs to go away. >> >> > > 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. > Looked at your > placeholder branch, now extractId looks much prettier and cleaner :) Good, then I understood how it works correctly. I'll merge it in when I get a chance. -- ---- Waylan Limberg wa...@gm... |
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... |
From: Yuri T. <qar...@gm...> - 2008-09-02 08:16:53
|
> Would anyone care if we lost all indenting and only did the linebreaks? I would guess that no. Python Markdown 1.7 is the only implementation in Babelmark that does any indentation. If we can do indentation right, perhaps that's an extra style point. However, if we don't do the indentation at all, then we get to be like everyone else, which is also nice. - yuri -- http://sputnik.freewisdom.org/ |
From: Waylan L. <wa...@gm...> - 2008-09-03 18:50:38
|
On Tue, Sep 2, 2008 at 4:17 AM, Yuri Takhteyev <qar...@gm...> wrote: >> Would anyone care if we lost all indenting and only did the linebreaks? > > I would guess that no. Python Markdown 1.7 is the only implementation > in Babelmark that does any indentation. If we can do indentation > right, perhaps that's an extra style point. However, if we don't do > the indentation at all, then we get to be like everyone else, which is > also nice. > I just committed this WITHOUT indentation [1] (linebreaks only). I've come to realize that the sample indentETree functions floating around out there are for xml - not html which has a different take on inline elements. I suppose someone could work off the now-working-in-all-edge-cases-I-could-find code and add indentation to that. But I get the feeling there will be quite a few additional edge-cases to work out and I have more important things to work on right now. [1]: http://gitorious.org/projects/python-markdown/repos/mainline/commits/a1c636a05557b1faa207828c9e7102391bdde5c9 -- ---- Waylan Limberg wa...@gm... |