From 80b38a743f68f01e4682c52a2606fe5846402f5f Mon Sep 17 00:00:00 2001 From: Massimo Date: Tue, 9 Apr 2013 16:13:55 -0500 Subject: [PATCH] [[http://link http://image img]] in markmin --- VERSION | 2 +- gluon/contrib/markmin/markmin2html.py | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index a4e30eec..1e9735c7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.6-stable+timestamp.2013.04.09.15.59.31 +Version 2.4.6-stable+timestamp.2013.04.09.16.13.21 diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py index 4bd0090f..b9a682f0 100755 --- a/gluon/contrib/markmin/markmin2html.py +++ b/gluon/contrib/markmin/markmin2html.py @@ -544,7 +544,7 @@ 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) -regex_auto = re.compile(r'(?/=])(?P\w+://[\w\d\-+_=?%&/:.]+)',re.M) +regex_auto = re.compile(r'(?/=])(?P\w+://[\w\d\-+_=?%&/:.,;#]+\w)',re.M) regex_link=re.compile(r'('+LINK+r')|\[\[(?P.+?)\]\]',re.S) regex_link_level2=re.compile(r'^(?P\S.*?)?(?:\s+\[(?P.+?)\])?(?:\s+(?P\S+))?(?:\s+(?P

popup))?\s*$',re.S) regex_media_level2=re.compile(r'^(?P\S.*?)?(?:\s+\[(?P.+?)\])?(?:\s+(?P\S+))?\s+(?P

img|IMG|left|right|center|video|audio)(?:\s+(?P\d+px))?\s*$',re.S) @@ -1239,13 +1239,26 @@ def render(text, k = escape(k) t = t or '' style = 'width:%s' % w if w else '' - title = ' title="%s"' % escape(a).replace(META, DISABLED_META) if a else '' + title = escape(a).replace(META, DISABLED_META) if a else '' p_begin = p_end = '' if p == 'center': p_begin = '

' p_end = '

'+pp + elif p == 'leftblock': + p_begin = '

' + p_end = '

'+pp + elif p == 'rightblock': + p_begin = '

' + p_end = '

'+pp elif p in ('left','right'): style = ('float:%s' % p)+(';%s' % style if style else '') + if title: + if regex_auto.match(title): + p_begin = p_begin + '
' % title + p_end = '' + p_end + title = '' + else: + title = ' title="%s"' % title if style: style = ' style="%s"' % style if p in ('video','audio'):