]> git.scottworley.com Git - paperdoorknob/blobdiff - domfilter.py
Learning TeX: Do Layouts with TeX macros
[paperdoorknob] / domfilter.py
index 22f96a13b23c51c02229b5a3eaf5740d37bf8303..f00721dd321dd0ece3697a90a563c171bc430930 100644 (file)
@@ -10,9 +10,14 @@ from typing import Any, Callable, List, Tuple
 from bs4.element import Tag
 
 
 from bs4.element import Tag
 
 
+def _changeTag(tag: Tag, new_name: str) -> Tag:
+    tag.name = new_name
+    return tag
+
+
 DOMFilters: List[Tuple[str, Callable[[Tag], Any]]] = [
 DOMFilters: List[Tuple[str, Callable[[Tag], Any]]] = [
-    ("NoEdit", lambda x: [eb.decompose() for eb in x.find_all("div", class_="post-edit-box")]),
-    ("NoFooter", lambda x: [foot.decompose() for foot in x.find_all("div", class_="post-footer")]),
+    ("Strike", lambda x: [_changeTag(span, 's')
+                          for span in x.find_all("span", style="text-decoration: line-through;")]),
 ]
 
 
 ]