From 479c0293ee104100779e49b7dd97fdf743f3389d Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Mon, 24 Mar 2025 16:36:01 +0300 Subject: [PATCH] Enhance debug JSON output formatting --- post_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post_parser.py b/post_parser.py index 42203e5..3158dc9 100644 --- a/post_parser.py +++ b/post_parser.py @@ -3,6 +3,7 @@ import copy import re import os import json +import html from datetime import datetime from typing import Union, Dict, Any, List @@ -301,7 +302,7 @@ class PostParser: if debug: debug_message = copy.deepcopy(message) debug_json = json.dumps(debug_message, default=str, indent=2, ensure_ascii=False) - html_content.append(f'
{debug_json}
') + html_content.append(f'
{html.escape(debug_json)}
') html_content = '\n'.join(html_content) return html_content