From 64b1ea3f8de6438cf4315c82f8115bcf114d1e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Boczar?= Date: Tue, 23 Apr 2024 10:10:51 +0200 Subject: [PATCH] fix(html): escape text in html output #29 --- elf_size_analyze/html/gen.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/elf_size_analyze/html/gen.py b/elf_size_analyze/html/gen.py index f161484..5a9c803 100644 --- a/elf_size_analyze/html/gen.py +++ b/elf_size_analyze/html/gen.py @@ -3,6 +3,7 @@ """ import os +import html THIS_DIR = os.path.dirname(os.path.abspath(os.path.realpath(__file__))) DEFAULT_CSS = os.path.join(THIS_DIR, 'styles.css') @@ -23,7 +24,7 @@ def _print_children(node, level=0): for x, y in node.items(): table_content += f""" - {x} + {html.escape(x)} {y['cumulative_size']} """ @@ -41,14 +42,14 @@ def _print_children(node, level=0): - {title} + {html.escape(title)} -

{title}

+

{html.escape(title)}

Collapse