Yomichan: add negative left margin to pitch accent marks in sankoku

This commit is contained in:
stephenmk 2023-07-19 13:28:13 -05:00
parent cfe1e98ab3
commit d6044e0c12
No known key found for this signature in database
GPG key ID: B6DA730DB06235F1
2 changed files with 3 additions and 2 deletions

View file

@ -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))

View file

@ -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):