diff --git a/yomichan/soup.py b/yomichan/soup.py index 84aeed7..572ce76 100644 --- a/yomichan/soup.py +++ b/yomichan/soup.py @@ -14,7 +14,7 @@ def __get_markup_structure(soup): content = [] for child in soup.children: if child.name is None: - text = child.text.replace("\n", "") + text = __clean(child.text) if text != "": content.append(text) else: @@ -34,6 +34,12 @@ def __get_markup_structure(soup): return node +def __clean(text): + text = text.replace("/", "/") + text = text.strip() + return text + + def __get_attributes(attrs): attributes = {} if "href" in attrs: