Yomichan: add negative left margin to pitch accent marks in sankoku
This commit is contained in:
parent
cfe1e98ab3
commit
d6044e0c12
|
@ -76,6 +76,7 @@ def __get_attributes(attrs):
|
||||||
|
|
||||||
|
|
||||||
def __get_style(inline_style_string):
|
def __get_style(inline_style_string):
|
||||||
|
# pylint: disable=no-member
|
||||||
style = {}
|
style = {}
|
||||||
parsed_style = parseStyle(inline_style_string)
|
parsed_style = parseStyle(inline_style_string)
|
||||||
if parsed_style.fontStyle != "":
|
if parsed_style.fontStyle != "":
|
||||||
|
@ -100,7 +101,7 @@ def __get_style(inline_style_string):
|
||||||
"marginLeft": parsed_style.marginLeft,
|
"marginLeft": parsed_style.marginLeft,
|
||||||
}
|
}
|
||||||
for key, val in margins.items():
|
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:
|
if m:
|
||||||
style[key] = float(m.group(1))
|
style[key] = float(m.group(1))
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ def __replace_accent_symbols(soup, media_dir):
|
||||||
elm.name = "span"
|
elm.name = "span"
|
||||||
elm.clear()
|
elm.clear()
|
||||||
elm.append(img)
|
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):
|
def __convert_gaiji(soup, media_dir):
|
||||||
|
|
Loading…
Reference in a new issue