X-Git-Url: https://projects.mako.cc/source/pyblosxom-markdown2/blobdiff_plain/f4830e7fa81cda7b3b85c9e3e4489e1298720466..af18764fbaee94dbb55a643fc7dbb07bbfd677b0:/markdown-plugin.py diff --git a/markdown-plugin.py b/markdown-plugin.py index 73e370a..1597445 100644 --- a/markdown-plugin.py +++ b/markdown-plugin.py @@ -20,29 +20,14 @@ Now any posts with filenames ending in one of the FILENAME_EXTENSIONS defined below will be passed through python-markdown. Copyright (C) Benjamin Mako Hill, 2005 -Updated for Python Markdown 2 by seanh 2009 - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later versi - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -USA. +Rewritten by seanh 2009, 2010 """ _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 @@ -52,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