remove unescape()

This commit is contained in:
2026-09-08 15:37:40 +02:00
parent ce7e0c6624
commit 218c27c726
+3 -3
View File
@@ -134,7 +134,8 @@ def clean_html(input_file, output_file):
#20260104: removed "span", </span>
#20260122: move the function check_input_name into the function clean_html as inner function
#20260128: removed text-align:justify in <p>
#version: 3_5_3_3
#20260129: added strikethrough tag: <s>, <del>, <ins>: insert with underline
#version: 3_5_3_5
def check_input_name(attribute):
ret_flag=False
@@ -157,7 +158,6 @@ def clean_html(input_file, output_file):
nb_lines = 0
for line_in in fi:
line_in = html.unescape(line_in)
line_out = ""
if not body:
@@ -235,7 +235,7 @@ def clean_html(input_file, output_file):
elif tag[0] in ["b", "/b", "em", "/em", "i", "/i", "li", "/li", "ol", "/ol",
"ul", "/ul", "strong", "/strong", "sub", "/sub", "sup", "/sup",
"u", "/u"]:
"u", "/u", "s", "/s", "del", "/del", "ins", "/ins"]:
line_out += "<{}>".format(tag[0])
elif tag[0] in ["/h1", "/h2", "/h3", "/h4", "/h5", "/h6", "/p",
"body", "/body", "/html", "/div", "/img", "/a"]: