added new formatters

This commit is contained in:
truePhilipp committed 2024-05-05 14:31:34 +02:00
1 parent 043b1e918f
commit 42715de295
8 files changed
+60 -4

No files matched your search

@@ -0,0 +1,8 @@
from bs4 import BeautifulSoup
def format(soup: BeautifulSoup) -> None:
for element in soup.find_all(attrs={"dj-attr": True}):
tag, value = element.get("dj-attr").split(";")
element[tag] = f"{{{{ {value} }}}}"
del element.attrs["dj-attr"]