diff options
Diffstat (limited to 'markdown_renderer.py')
| -rw-r--r-- | markdown_renderer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/markdown_renderer.py b/markdown_renderer.py index 1e7c755..7c1bd0b 100644 --- a/markdown_renderer.py +++ b/markdown_renderer.py @@ -8,8 +8,10 @@ class DefaultClassTreeprocessor(markdown.treeprocessors.Treeprocessor): def run(self, root): for element in root.iter("a"): print(element.attrib) - if "class" not in element.attrib or "button" not in element.attrib["class"]: + if "class" not in element.attrib: element.set("class", "link") + elif "button" not in element.attrib["class"]: + element.set("class", element.attrib["class"] + " link") if "href" in element.attrib and element.attrib["href"] == "": del element.attrib["href"] for element in root.iter("img"): |
