diff --git a/bot/yomichan/glossary/gloss.py b/bot/yomichan/glossary/gloss.py index c94e5aa..705cd7e 100644 --- a/bot/yomichan/glossary/gloss.py +++ b/bot/yomichan/glossary/gloss.py @@ -76,6 +76,7 @@ def __get_attributes(attrs): def __get_style(inline_style_string): + # pylint: disable=no-member style = {} parsed_style = parseStyle(inline_style_string) if parsed_style.fontStyle != "": @@ -100,7 +101,7 @@ def __get_style(inline_style_string): "marginLeft": parsed_style.marginLeft, } for key, val in margins.items(): - m = re.search(r"(\d+(\.\d*)?|\.\d+)em", val) + m = re.search(r"(-?\d+(\.\d*)?|-?\.\d+)em", val) if m: style[key] = float(m.group(1)) diff --git a/bot/yomichan/glossary/sankoku8.py b/bot/yomichan/glossary/sankoku8.py index 5501381..17cf6d9 100644 --- a/bot/yomichan/glossary/sankoku8.py +++ b/bot/yomichan/glossary/sankoku8.py @@ -248,7 +248,7 @@ def __replace_accent_symbols(soup, media_dir): elm.name = "span" elm.clear() elm.append(img) - elm.attrs["style"] = "vertical-align: text-bottom;" + elm.attrs["style"] = "vertical-align: text-bottom; margin-left: -0.3em;" def __convert_gaiji(soup, media_dir):