]> projects.mako.cc - pyblosxom-markdown2/commitdiff
Get rid of the to_ascii function that was stripping non-ascii characters
authorSean Hammond <seanhammond@lavabit.com>
Tue, 28 Sep 2010 00:43:32 +0000 (01:43 +0100)
committerSean Hammond <seanhammond@lavabit.com>
Tue, 28 Sep 2010 00:43:32 +0000 (01:43 +0100)
from blog posts.

markdown-plugin.py

index 6b03ed92cb96b5e57a71fbd3f3255196b9130d2e..522823d843b7cfeaa854e75172e567c102093570 100644 (file)
@@ -70,19 +70,9 @@ def cb_preformat(args):
     if args['parser'] == PREFORMATTER_ID:
         return parse(''.join(args['story']))
 
-def to_ascii(char):
-    """Return char if char is an ASCII character, '?' otherwise."""
-    if ord(char) < 128:
-        return char
-    else:
-        return '?'
-
 def parse(story):
-    # Replace any non-ascii characters in the story with '?', so that
-    # python-markdown doesn't crash.
-    ascii = "".join([to_ascii(x) for x in story])
     # Convert the ASCII text to HTML with python-markdown.
-    html = md.convert(ascii)
+    html = md.convert(story)
     # Reset python-markdown ready for next time.
     md.reset()
     return html

Benjamin Mako Hill || Want to submit a patch?