Skip to content

Commit

Permalink
🍱 Added htmlspecialchars() for easyer filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
pheeef committed May 29, 2021
1 parent f2e828f commit 657db27
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def htmlspecialchars(text: str):
return (
text.replace("&", "&").
replace('"', """).
replace("<", "&lt;").
replace(">", "&gt;")
)

0 comments on commit 657db27

Please sign in to comment.