first commit
This commit is contained in:
commit
a3dbf9cbe3
16 files changed
+471
No files matched your search
@@ -0,0 +1,13 @@
|
||||
"""
|
||||
Find tags with a "dj-var" attribute and replace its content with the
|
||||
value enclosed in {{ }}.
|
||||
"""
|
||||
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
def format(soup: BeautifulSoup) -> None:
|
||||
for element in soup.find_all(attrs={"dj-var": True}):
|
||||
element.string = f"{{{{ {element.get("dj-var")} }}}}"
|
||||
del element.attrs["dj-var"]
|
||||
Reference in new issue
Block a user