From 11c9c6437a3a6bd63a14fec46da1f371d45bc8c1 Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Tue, 28 Sep 2010 01:43:32 +0100 Subject: [PATCH 1/1] Get rid of the to_ascii function that was stripping non-ascii characters from blog posts. --- markdown-plugin.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/markdown-plugin.py b/markdown-plugin.py index 6b03ed9..522823d 100644 --- a/markdown-plugin.py +++ b/markdown-plugin.py @@ -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 -- 2.39.5