Skip to content
Snippets Groups Projects

Fix add_class_to_el templatetag to work with lists for classes

Merged Jonathan Weth requested to merge fix/add-class-to-el-multiple-classes into master
All threads resolved!
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -15,6 +15,6 @@ def add_class_to_el(value: str, arg: str) -> str:
soup = BeautifulSoup(value, "html.parser")
for el in soup.find_all(el):
el["class"] = el.get("class", "") + f" {cls}"
el["class"] = el.get("class", []) + [cls]
return str(soup)
Loading