From 14bd35e348154fd66d8ed63b4d44e248045d52f9 Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Wed, 30 Jan 2013 09:41:41 -0600
Subject: [PATCH] fixed issue 1306 rendering of width in markmin, thanks
dickschrauwen
---
VERSION | 2 +-
gluon/contrib/markmin/markmin2html.py | 27 ++++++++++++++-------------
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/VERSION b/VERSION
index db093562..863d2fec 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.4.1-alpha.2+timestamp.2013.01.30.09.29.07
+Version 2.4.1-alpha.2+timestamp.2013.01.30.09.40.42
diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py
index 0f56b603..cbdcec47 100755
--- a/gluon/contrib/markmin/markmin2html.py
+++ b/gluon/contrib/markmin/markmin2html.py
@@ -609,7 +609,7 @@ def protolinks_simple(proto, url):
#elif proto == 'embed': # NOTE: embed is a synonym to iframe now
# return '%s>'%(url,class_prefix,url)
elif proto == 'qr':
- return ''%url
+ return ''%url
return proto+':'+url
def render(text,
@@ -701,7 +701,7 @@ def render(text,
'
'
>>> render('[[this is an image http://example.com left 200px]]')
- '
'
+ '
'
>>> render("[[Your browser doesn't support
'
+ '
title11:
'
>>> render(r"\\[[probe]]")
'
[[probe]]
'
@@ -1236,23 +1236,24 @@ def render(text,
return m.group(0)
k = escape(k)
t = t or ''
- width = ' width="%s"' % w if w else ''
+ style = 'width:%s' % w if w else ''
title = ' title="%s"' % escape(a).replace(META, DISABLED_META) if a else ''
- style = p_begin = p_end = ''
+ p_begin = p_end = ''
if p == 'center':
p_begin = '
'
p_end = '
'+pp
elif p in ('left','right'):
- style = ' style="float:%s"' % p
+ style = ('float:%s' % p)+(';%s' % style if style else '')
+ if style:
+ style = ' style="%s"' % style
if p in ('video','audio'):
t = render(t, {}, {}, 'br', URL, environment, latex,
autolinks, protolinks, class_prefix, id_prefix, pretty_print)
- return '<%(p)s controls="controls"%(title)s%(width)s>%(t)s%(p)s>' \
- % dict(p=p, title=title, width=width, k=k, t=t)
+ return '<%(p)s controls="controls"%(title)s%(style)s>%(t)s%(p)s>' \
+ % dict(p=p, title=title, style=style, k=k, t=t)
alt = ' alt="%s"'%escape(t).replace(META, DISABLED_META) if t else ''
- return '%(begin)s%(end)s' \
- % dict(begin=p_begin, k=k, alt=alt, title=title,
- style=style, width=width, end=p_end)
+ return '%(begin)s%(end)s' \
+ % dict(begin=p_begin, k=k, alt=alt, title=title, style=style, end=p_end)
def sub_link(m):
t,a,k,p = m.group('t','a','k','p')