escape html < and > chars

This commit is contained in:
Akbar Rahman 2021-08-22 21:47:54 +01:00
parent c8d70a3661
commit 78def54645

View File

@ -211,7 +211,7 @@ def main(args):
html = re.sub(r'\$raw\$', os.path.basename(filename), html) html = re.sub(r'\$raw\$', os.path.basename(filename), html)
html = html.replace('$filehistory$', filehistory) html = html.replace('$filehistory$', filehistory)
with open(filename) as fp: with open(filename) as fp:
html += fp.read() html += fp.read().replace("<", "&lt;").replace(">", "&gt;")
html += TEXT_ARTICLE_TEMPLATE_FOOT html += TEXT_ARTICLE_TEMPLATE_FOOT
with open(output_filename, 'w+') as fp: with open(output_filename, 'w+') as fp: