From 94c79820b9ba65476063dc250dee8e46782966af Mon Sep 17 00:00:00 2001 From: Massimo Date: Tue, 9 Apr 2013 16:33:45 -0500 Subject: [PATCH] links with images in markmin --- VERSION | 2 +- gluon/contrib/markmin/markmin2html.py | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/VERSION b/VERSION index 1e9735c7..c0fd6d42 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.6-stable+timestamp.2013.04.09.16.13.21 +Version 2.4.6-stable+timestamp.2013.04.09.16.33.11 diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py index b9a682f0..f29ea8bf 100755 --- a/gluon/contrib/markmin/markmin2html.py +++ b/gluon/contrib/markmin/markmin2html.py @@ -547,7 +547,7 @@ regex_proto = re.compile(r'(?/=])(?P

\w+):(?P\w+://[\w\d\-+=?%&/:.]+ 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) +regex_media_level2=re.compile(r'^(?P\S.*?)?(?:\s+\[(?P.+?)\])?(?:\s+(?P\S+))?\s+(?P

img|IMG|left|right|center|video|audio|blockleft|blockright)(?:\s+(?P\d+px))?\s*$',re.S) regex_markmin_escape = re.compile(r"(\\*)(['`:*~\\[\]{}@\$+\-.#\n])") regex_backslash = re.compile(r"\\(['`:*~\\[\]{}@\$+\-.#\n])") @@ -1239,26 +1239,23 @@ def render(text, k = escape(k) t = t or '' style = 'width:%s' % w if w else '' - title = escape(a).replace(META, DISABLED_META) if a else '' + title = ' title="%s"' % escape(a).replace(META, DISABLED_META) if a else '' p_begin = p_end = '' if p == 'center': p_begin = '

' p_end = '

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

' p_end = '

'+pp - elif p == 'rightblock': + elif p == 'blockright': 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 t and regex_auto.match(t): + p_begin = p_begin + '' % t + p_end = '' + p_end + t = '' if style: style = ' style="%s"' % style if p in ('video','audio'):