added tests for all formatters; stylecheck workflow now also checks in tests now

This commit is contained in:
truePhilipp committed 2024-05-06 22:26:45 +02:00
1 parent 2f3f45151d
commit c3f7fd88bb
18 files changed
+364 -14

No files matched your search

+2 -2
View File
@@ -3,6 +3,6 @@ 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} }}}}"
for tag, value in [attr.split(";") for attr in element["dj-attr"].split("~")]:
element[tag] = f"{{{{ {value} }}}}"
del element.attrs["dj-attr"]