minor tweak to alter_size for font-sizes
This commit is contained in:
parent
2ea1d28e11
commit
a83c006d05
|
@ -23,8 +23,9 @@ def parse_html(value, m):
|
||||||
p = "font\-size: [0-9][0-9]?px"
|
p = "font\-size: [0-9][0-9]?px"
|
||||||
matches = re.findall(p, value)
|
matches = re.findall(p, value)
|
||||||
for match in matches:
|
for match in matches:
|
||||||
s = match.replace("font-size: ", "")
|
# reg = r'font-size:[\s?]
|
||||||
val = int(s.replace("px", ""))
|
s = match.replace("font-size:", "")
|
||||||
|
val = int(s.strip().replace("px", ""))
|
||||||
new_val = int(round(val * m))
|
new_val = int(round(val * m))
|
||||||
r = "font-size: " + str(new_val) + "px"
|
r = "font-size: " + str(new_val) + "px"
|
||||||
value = value.replace(match, r)
|
value = value.replace(match, r)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user