Le 2008-03-22 à 13:57, Yuri Takhteyev a écrit :

2-tier list indented by three spaces:
http://michelf.com/projects/babelmark/?markdown=*+what%27s+up%3F%0D%0A+++*+ok

Now, on this one, I must say I have mixed feelings, since
python-markdown is the only implementation that follows "Markdown
Syntax"  and treats the item indented by three spaces as being at the
same level.  Makes me feel like a naive fool for following the "spec".
:)

Well, you've been following the official spec; no one should call you a fool for that. But it certainly doesn't give much leverage to the idea of keeping the spec as it is.

One more thing: python-markdown is a stickler for explicit encoding
(because we rely on it for bidi-detection).  The input must be either
python Unicode object or UTF8 encoded byte-string or you must say what
encoding you are using.  Your test doesn't seems to send something
other than UTF8 without specifying encoding.

http://michelf.com/projects/babelmark/?markdown=_%D8%A7%D9%84%D9%92%D8%B9%D9%8E%D8%B1%D9%8E%D8%A8%D9%8A%D9%91%D8%A9_+

Ah, good catch. Should be fixed now.

Note that I haven't been using Python Markdown's script directly since I didn't find how to use the standard input with it. So I've written a 4-line python stub which does the job of collecting the input and calling the markdown function inside markdown.py. Here's the script (after the fix):

    import sys, codecs, markdown
    text = unicode(sys.stdin.read(), "utf-8")
    html = markdown.markdown(text)
    sys.stdout.write(html.encode("utf-8"))

Should we start a page on the wiki to collect those examples so that we can then discuss what ought to be done in each case?


Sure, we could...

But I think we already have half of this in the form of a testsuite, and the other half in the form of this email discussion list. As I said already, I'm open to adding new tests to MDTest, things like the above for instance, and I'm open to discussion about what the expected output should be.

If you want, you could build a separate testsuite for Python Markdown that I'll add to the next release of MDTest. The more implementations can pass each other's testsuite the better interoperability we'll have achieved.


Michel Fortin
[EMAIL PROTECTED]
http://michelf.com/


_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss

Reply via email to