fix first replacement being used everywhere when processing inline images

This commit is contained in:
Sumpfork 2016-12-16 13:52:52 -08:00
parent 732a4c79bf
commit b6054ed6bb

View File

@ -232,9 +232,10 @@ class DividerDrawer(object):
fontsize_multiplier, fontsize_multiplier,
height_percent, height_percent,
text_fontsize_multiplier=None): text_fontsize_multiplier=None):
replace = '<img src="{fpath}" width={width} height="{height_percent}%" valign="middle" />&thinsp;' replace_template = '<img src="{fpath}" width={width} height="{height_percent}%" valign="middle" />&thinsp;'
offset = 0 offset = 0
for match in re.finditer(tag_pattern, text): for match in re.finditer(tag_pattern, text):
replace = replace_template
tag = match.group(0) tag = match.group(0)
fname = re.sub(tag_pattern, fname_replace, tag) fname = re.sub(tag_pattern, fname_replace, tag)
if text_fontsize_multiplier is not None: if text_fontsize_multiplier is not None: