From 9599a0e600d3bc34ee72f6c2a58a1427b8dd980f Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Mon, 7 Feb 2022 10:35:15 +0000 Subject: [PATCH] html escape html --- musicutil/commands/genhtml_command.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/musicutil/commands/genhtml_command.py b/musicutil/commands/genhtml_command.py index ee46134..17b7c8a 100644 --- a/musicutil/commands/genhtml_command.py +++ b/musicutil/commands/genhtml_command.py @@ -1,6 +1,8 @@ from musicutil.utils.load_tag_information import load_tag_information from musicutil.utils.scan_for_music import scan_for_music +from html import escape as escape_html + class GenHTMLArgs(): src: str dest: str @@ -80,12 +82,17 @@ class GenHTMLCommand(): for file in files: tdClass = "pure-table-odd" if isOdd else "pure-table-even" + data_path = escape_html(file.path_from_src) + data_title = escape_html(file.tags.title) + data_artist = escape_html(file.tags.artist) + data_extension = escape_html(file.extension) + html_content += f""" - {file.path_from_src} - {file.tags.title} - {file.tags.artist} - {file.extension} + {data_path} + {data_title} + {data_artist} + {data_extension} """ isOdd = not isOdd