From: Matthias U. <sm...@sm...> - 2008-12-24 20:32:13
|
Hi, Is there an extension for email-style quoting, so that text like ... foo wrote: > bar wrote: >> baz > whatever >> quux > right wrong ... looks reasonably sane (i.e. nested blockquote tags, ideally with support for RFC 2646)? Pointers appreciated. -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | sm...@sm... Disclaimer: Das Zitat wurde zufällig ausgewählt. | http://smurf.noris.de - - Gerade der Freie sucht den Schein der Freiheit am wenigsten. -- Jean Paul |
From: Waylan L. <wa...@gm...> - 2008-12-24 21:07:34
|
Actually markdown does blockquotes out of the box. The email style is the markdown syntax for blockquotes [1] with some restrictions. The reason your example doesn't work as expected is that markdown *insists* on a blank line between each block-level element. So either of the following will give you your expected output: foo wrote: > bar wrote: > > > baz > > whatever > > > quux > > right > wrong Or: foo wrote: > bar wrote: > > baz > whatever > > quux > right wrong Note that the double quoted lines have a space between the >s. Again, this is a requirement of the markdown syntax. To play with it, I suggest babelmark [2]. So to answer your question directly, no, there is no extension as the existing syntax is good enough for most (all?) users. However, if you want to tweak the existing behavior, then you are welcome to write your own extension. I suggest looking at the code on gitorious [3] which will be released as 2.0 soonish. It's much easier to alter the core than in 1.7. The docs [4] should help you out with that. Just be aware that until 2.0 is released, the API is subject to change - although I don't anticipate much change. [1]: http://daringfireball.net/projects/markdown/syntax#blockquote [2]: http://tinyurl.com/9xgjh3 [3]: http://gitorious.org/projects/python-markdown/repos/mainline [4]: http://gitorious.org/projects/python-markdown/repos/mainline/blobs/master/docs/writing_extensions.txt On Wed, Dec 24, 2008 at 3:31 PM, Matthias Urlichs <sm...@sm...> wrote: > Hi, > > Is there an extension for email-style quoting, so that text like ... > > foo wrote: >> bar wrote: >>> baz >> whatever >>> quux >> right > wrong > > ... looks reasonably sane (i.e. nested blockquote tags, ideally with > support for RFC 2646)? > > Pointers appreciated. > > -- > Matthias Urlichs | {M:U} IT Design @ m-u-it.de | sm...@sm... > Disclaimer: Das Zitat wurde zufällig ausgewählt. | http://smurf.noris.de > - - > Gerade der Freie sucht den Schein der Freiheit am wenigsten. > -- Jean Paul > > ------------------------------------------------------------------------------ > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > -- ---- Waylan Limberg wa...@gm... |
From: Yuri T. <qar...@gm...> - 2008-12-24 22:04:39
|
Actually, it's the lack of spaces after blockquotes. If you change Matthias's example to make sure there is a space after every angle bracket, it works quite reasonably. I think this is a bug, actually, because there is no reason we should require that space, and Matthias's example does work many (though not all) other implementations. It looks like a small change makes the example work, though it breaks one of our tests. Committed the change for now (as 8f3f5a9) and will try to look into what's the deal with the test. - yuri On Wed, Dec 24, 2008 at 7:07 PM, Waylan Limberg <wa...@gm...> wrote: > Actually markdown does blockquotes out of the box. The email style is > the markdown syntax for blockquotes [1] with some restrictions. > > The reason your example doesn't work as expected is that markdown > *insists* on a blank line between each block-level element. So either > of the following will give you your expected output: > > foo wrote: > > > bar wrote: > > > > > baz > > > > whatever > > > > > quux > > > > right > > wrong > > Or: > > foo wrote: > > > bar wrote: > > > > baz > > > whatever > > > > quux > > > right > wrong > > Note that the double quoted lines have a space between the >s. Again, > this is a requirement of the markdown syntax. To play with it, I > suggest babelmark [2]. > > So to answer your question directly, no, there is no extension as the > existing syntax is good enough for most (all?) users. However, if you > want to tweak the existing behavior, then you are welcome to write > your own extension. I suggest looking at the code on gitorious [3] > which will be released as 2.0 soonish. It's much easier to alter the > core than in 1.7. The docs [4] should help you out with that. Just be > aware that until 2.0 is released, the API is subject to change - > although I don't anticipate much change. > > [1]: http://daringfireball.net/projects/markdown/syntax#blockquote > [2]: http://tinyurl.com/9xgjh3 > [3]: http://gitorious.org/projects/python-markdown/repos/mainline > [4]: http://gitorious.org/projects/python-markdown/repos/mainline/blobs/master/docs/writing_extensions.txt > > On Wed, Dec 24, 2008 at 3:31 PM, Matthias Urlichs <sm...@sm...> wrote: >> Hi, >> >> Is there an extension for email-style quoting, so that text like ... >> >> foo wrote: >>> bar wrote: >>>> baz >>> whatever >>>> quux >>> right >> wrong >> >> ... looks reasonably sane (i.e. nested blockquote tags, ideally with >> support for RFC 2646)? >> >> Pointers appreciated. >> >> -- >> Matthias Urlichs | {M:U} IT Design @ m-u-it.de | sm...@sm... >> Disclaimer: Das Zitat wurde zufällig ausgewählt. | http://smurf.noris.de >> - - >> Gerade der Freie sucht den Schein der Freiheit am wenigsten. >> -- Jean Paul >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Python-markdown-discuss mailing list >> Pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss >> > > > > -- > ---- > Waylan Limberg > wa...@gm... > ------------------------------------------------------------------------------ > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > -- http://sputnik.freewisdom.org/ |
From: Waylan L. <wa...@gm...> - 2008-12-24 23:36:12
|
On Wed, Dec 24, 2008 at 4:36 PM, Yuri Takhteyev <qar...@gm...> wrote: > Actually, it's the lack of spaces after blockquotes. If you change > Matthias's example to make sure there is a space after every angle > bracket, it works quite reasonably. I disagree. The "whatever" and "right" lines in Mathias' example should step out of the second level and according to babelmark, every implementation except Maruku gets that wrong by including everything past the first line of the second level in the second level. The only way to avoid that is with blank lines. So the issue (not specific to python) is blank lines more that spaces after >s. To take this further it occurred to me after my last response, that the last line of Mattias' example was not meant to be part of any blockquote, but a response to the first level blockquote. Per the syntax, the only way that will work is with a blank line. Compare: > right wrong to this: > rigth wrong The syntax is very clear that the first example above must result in: <blockquote> <p>right wrong</p> </blockquote> While I suspect the desired result was this (which is obtained by the second example above): <blockquote> <p>right</p> </blockquote> <p>wrong</p> So yeah, the issue is blank lines. However, this is *not* a bug in markdown, but a feature. Yes it does restrict the author a little, but it is necessary given the syntax rules as they are written. > I think this is a bug, actually, because there is no reason we should > require that space, and Matthias's example does work many (though not > all) other implementations. Personally, I prefer requiring the space - but then I always did prefer stricter whitespace in the syntax than most people. Whatever. -- ---- Waylan Limberg wa...@gm... |
From: Waylan L. <wa...@gm...> - 2008-12-24 23:58:00
|
On Wed, Dec 24, 2008 at 6:36 PM, Waylan Limberg <wa...@gm...> wrote: > On Wed, Dec 24, 2008 at 4:36 PM, Yuri Takhteyev <qar...@gm...> wrote: >> Actually, it's the lack of spaces after blockquotes. If you change >> Matthias's example to make sure there is a space after every angle >> bracket, it works quite reasonably. > > I disagree. The "whatever" and "right" lines in Mathias' example > should step out of the second level and according to babelmark, every > implementation except Maruku gets that wrong by including everything > past the first line of the second level in the second level. Well, the implementations don't get it wrong, but they do output something different than what I suspect Mattias was expecting. Sorry, that is what I was trying to say. Bad choice of words. -- ---- Waylan Limberg wa...@gm... |
From: Matthias U. <sm...@sm...> - 2008-12-25 09:50:10
|
Hi, Waylan Limberg: > Well, the implementations don't get it wrong, but they do output > something different than what I suspect Mattias was expecting. Sorry, > that is what I was trying to say. Bad choice of words. > No problem. So I suspect that a simple "insert a blank line whenever the indent level changes, and insist on one space between the angles" filter should do the right thing. Thanks, that was easy. ;-) For additional perfection, I'd like to tag the attribution line in front of a quote block with some special class so that I can CSS it up to look like an attribution instead of a random paragraph (i.e. italics, and no excessive whitespace between the two). But I'll download version 2 before thinking further about that. -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | sm...@sm... Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de v4sw7$Yhw6+8ln7ma7u7L!wl7DUi2e6t3TMWb8HAGen6g3a4s6Mr1p-3/-6 hackerkey.com - - Data, n.: An accrual of straws on the backs of theories. |
From: Yuri T. <qar...@gm...> - 2009-01-02 15:42:01
|
> For additional perfection, I'd like to tag the attribution line in front > of a quote block with some special class so that I can CSS it up to look > like an attribution instead of a random paragraph (i.e. italics, and no > excessive whitespace between the two). But I'll download version 2 > before thinking further about that. We try to stick close to standard markdown by default, and this wouldn't be the standard markdown behavior. However, what you want to do could be easily done with an extension. You should have a look at the (new) extension API. The purpose of the extension API is precisely to allow people to customize markdown while the core markdown can stay compliant with other implementations. (Sorry about the slow response - I was traveling.) - yuri -- http://sputnik.freewisdom.org/ |