chore: commenting of sanizier.py
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
#
|
||||||
|
# src/sanitizer.py
|
||||||
|
# AGPL-3.0 - saningi-html
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
import bleach
|
import bleach
|
||||||
from profiles import STRICT, LOOSE
|
from profiles import STRICT, LOOSE
|
||||||
from log.Logger import *
|
from log.Logger import *
|
||||||
@@ -9,6 +15,15 @@ PROFILES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def sanitize(html : str, mode : str) -> str:
|
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
|
# this should be used with caution! it is for trusted
|
||||||
# individuals only
|
# individuals only
|
||||||
if mode == "passthrough":
|
if mode == "passthrough":
|
||||||
|
|||||||
Reference in New Issue
Block a user