chore: commenting of sanizier.py
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
#
|
||||
# src/sanitizer.py
|
||||
# AGPL-3.0 - saningi-html
|
||||
#
|
||||
|
||||
|
||||
import bleach
|
||||
from profiles import STRICT, LOOSE
|
||||
from log.Logger import *
|
||||
@@ -9,6 +15,15 @@ PROFILES = {
|
||||
}
|
||||
|
||||
def sanitize(html : str, mode : str) -> str:
|
||||
"""
|
||||
Arguments:
|
||||
html : str -> input html
|
||||
mode : str -> the defined mode which is from profiles.py ; or PROFILES variable
|
||||
|
||||
Functionality:
|
||||
This function takes in HTML sanitzies it with bleach and returns clean HTML
|
||||
"""
|
||||
|
||||
# this should be used with caution! it is for trusted
|
||||
# individuals only
|
||||
if mode == "passthrough":
|
||||
|
||||
Reference in New Issue
Block a user