From a83c006d05781e3fc96ad836853ff4bb4cc05ff5 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 6 Jul 2011 19:07:02 +0530 Subject: [PATCH] minor tweak to alter_size for font-sizes --- edgware/editor/templatetags/alter_size.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/edgware/editor/templatetags/alter_size.py b/edgware/editor/templatetags/alter_size.py index 9a932c4..d975eca 100644 --- a/edgware/editor/templatetags/alter_size.py +++ b/edgware/editor/templatetags/alter_size.py @@ -23,8 +23,9 @@ def parse_html(value, m): p = "font\-size: [0-9][0-9]?px" matches = re.findall(p, value) for match in matches: - s = match.replace("font-size: ", "") - val = int(s.replace("px", "")) +# reg = r'font-size:[\s?] + s = match.replace("font-size:", "") + val = int(s.strip().replace("px", "")) new_val = int(round(val * m)) r = "font-size: " + str(new_val) + "px" value = value.replace(match, r)