@@ -1,6 +1,7 @@ -#!/usr/bin/env python # created my Massimo Di Pierro +#!/usr/bin/env python +# created my Massimo Di Pierro # license MIT/BSD/GPL import re import cgi __all__ = ['render', 'markmin2html'] @@ -395,11 +396,13 @@ # the << indicates that there should NOT be a new paragraph # META indicates a code block therefore no new paragraph ############################################################# items = [item.strip() for item in text.split('\n\n')] if sep=='p': - text = ''.join(p[:2]!='<<' and p!=META and '

%s

'%p or '%s'%p for p in items if p) + text = ''.join( + (p[:2]!='<<' and p!=META and '

%s

'%p or '%s'%p) \ + for p in items if p.strip()) elif sep=='br': text = '
'.join(items) ############################################################# # finally get rid of << @@ -451,5 +454,6 @@ print ''+markmin2html(fargv.read())+'' finally: fargv.close() else: doctest.testmod() +