From bf42dfbb5c4722e5babb034100fd1aa7a96b4b3d Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 11 Sep 2012 08:35:58 -0500 Subject: [PATCH] markmin improvement thanks Villas and Vladyslav --- VERSION | 2 +- gluon/contrib/markmin/markmin2html.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/VERSION b/VERSION index 4bd8a558..6e68dbc3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.8 (2012-09-11 08:24:53) stable +Version 2.0.8 (2012-09-11 08:35:54) stable diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py index 1820c620..78b29748 100755 --- a/gluon/contrib/markmin/markmin2html.py +++ b/gluon/contrib/markmin/markmin2html.py @@ -540,7 +540,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) @@ -1165,17 +1165,17 @@ def render(text, (lev, mtag, lineno)= parse_list(t2, p, ss, 'ol', lev, mtag, lineno) lineno+=1 continue - elif c0 == '-': # unordered list - (lev, mtag, lineno) = parse_list(t2, p, ss, 'ul', lev, mtag, lineno) - lineno+=1 - continue + elif c0 == '-': # unordered list, table or blockquote + if p or ss: + (lev, mtag, lineno) = parse_list(t2, p, ss, 'ul', lev, mtag, lineno) + lineno+=1 + continue + else: + (s, mtag, lineno) = parse_table_or_blockquote(s, mtag, lineno) elif lev>0: # and c0 == '.' # paragraph in lists (lev, mtag, lineno) = parse_point(t2, ss, lev, mtag, lineno) lineno+=1 continue - else: - if c0 == '-': # table or blockquote? - (s, mtag, lineno) = parse_table_or_blockquote(s, mtag, lineno) if lev == 0 and (mtag == 'q' or s == META): # new paragraph