testing python-markdown

Yuri T. qaramazov at gmail.com
Mon Aug 15 00:47:45 EDT 2005


Thanks for the suggestions.


> source for an older version of PHP Markdown, and it looks like he's

> just doing it by looking for nested `[]` pairs up to 6 levels deep


I've thought of doing this, but this seems really ugly... I'll see if
I can come up with something more pythonic.


> So your lists never add <p> tags?


I add p tags on all paragraphs except for the first. I determine
whether to put a <p> tag by checking if the parent element already has
children.


> Then we replace the tab with the right number of spaces. The right

> number of spaces is

>

> 4 - length($1) % 4


Ok, it's good to know what this is supposed to do. In this case
everything is doable easily without magic and in fact without any
regular expressions. I seem to get the same result simply from:

def detab(str) :
while 1:
i = str.find("\t")
if i < 0 : break
else : str= str[:i] + " "*(TABLENGTH-i%TABLENGTH) + str[i+1:]
return str

I'll add this in.

- yuri


More information about the Markdown-Discuss mailing list