From 560f04982505ade3658eed9725f6f91c83460fb4 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sat, 11 Aug 2012 14:44:02 -0500 Subject: [PATCH] minor change in markmin supports #head --- VERSION | 2 +- gluon/contrib/markmin/markmin2html.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 7383dab8..2d4e7f4d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-10 13:01:31) dev +Version 2.00.0 (2012-08-11 14:43:56) dev diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py index 98744a3a..3e0fa2c7 100755 --- a/gluon/contrib/markmin/markmin2html.py +++ b/gluon/contrib/markmin/markmin2html.py @@ -519,7 +519,7 @@ regex_strong=re.compile(r'\*\*(?P[^\s*]+( +[^\s*]+)*)\*\*') regex_del=re.compile(r'~~(?P[^\s*]+( +[^\s*]+)*)~~') regex_em=re.compile(r"''(?P[^\s']+(?: +[^\s']+)*)''") regex_num=re.compile(r"^\s*[+-]?((\d+(\.\d*)?)|\.\d+)([eE][+-]?[0-9]+)?\s*$") -regex_list=re.compile('^(?:(#{1,6}|\.+|\++|\-+)(\.)?\s+)?(.*)$') +regex_list=re.compile('^(?:(#{1,6}|\.+ |\++ |\++\. |\-+ |\-+\. )\s*)?(.*)$') regex_bq_headline=re.compile('^(?:(\.+|\++|\-+)(\.)?\s+)?(-{3}-*)$') regex_tq=re.compile('^(-{3}-*)(?::(?P[a-zA-Z][_a-zA-Z\-\d]*)(?:\[(?P

[a-zA-Z][_a-zA-Z\-\d]*)\])?)?$') regex_proto = re.compile(r'(?/=])(?P

\w+):(?P\w+://[\w\d\-+=?%&/:.]+)', re.M) @@ -1099,9 +1099,13 @@ def render(text, c0=s[:1] if c0: # for non empty strings if c0 in "#+-.": # first character is one of: # + - . - (t,p,s) = regex_list.findall(s)[0] # t - tag ("###", "+++", "---", "...") - # p - paragraph point ('.')->for "++." or "--." - # s - other part of string + match = regex_list.search(s) + (t,p,s) = match.group(1), None, match.group(2) + t = (t or '').strip() + if t.endswith('.'): t, p = t[:-1], '.' + # t - tag ("###", "+++", "---", "...") + # p - paragraph point ('.')->for "++." or "--." + # s - other part of string if t: # headers and lists: if c0 == '#': # headers