From af18764fbaee94dbb55a643fc7dbb07bbfd677b0 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Sun, 10 Apr 2011 15:39:33 -0400 Subject: [PATCH 1/1] added support for UTF-8 documents Fixed issue where the it would return 500 when certain unicode characters were used. --- markdown-plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/markdown-plugin.py b/markdown-plugin.py index f60b9a3..1597445 100644 --- a/markdown-plugin.py +++ b/markdown-plugin.py @@ -27,7 +27,7 @@ _version__ = '0.3' __author__ = 'Benjamin Mako Hill ' __author__ = 'seanh ' -FILENAME_EXTENSIONS = ('.txt','.text','.mkdn','.markdown','.md','.mdown','.markdn','.mkd') +FILENAME_EXTENSIONS = ('.mdwn', '.txt','.text','.mkdn','.markdown','.md','.mdown','.markdn','.mkd') import markdown import os @@ -37,6 +37,6 @@ md = markdown.Markdown(output_format='html4',extensions=['extra',]) def cb_story(args): entry = args['entry'] if os.path.splitext(entry['filename'])[1] in FILENAME_EXTENSIONS: - entry['body'] = md.convert(''.join(entry['body'])) + entry['body'] = md.convert(u''.join(entry['body'].decode("utf-8"))) md.reset() - return args \ No newline at end of file + return args -- 2.39.5