From 15f51108ddac51e56502976bbd08f720322fb01d Mon Sep 17 00:00:00 2001 From: Slipstream Date: Wed, 21 May 2025 13:38:48 -0600 Subject: [PATCH] Fix: Escape CSS curly braces in HTML templates Update inline CSS within `HTML_TEMPLATE` and the root endpoint's HTML. Double curly braces `{{` and `}}` are now used for CSS rules to prevent the templating engine from misinterpreting single curly braces `{}` as placeholders, ensuring correct CSS rendering. --- run_markdown_server.py | 73 +++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/run_markdown_server.py b/run_markdown_server.py index c949971..da92171 100644 --- a/run_markdown_server.py +++ b/run_markdown_server.py @@ -28,6 +28,7 @@ except ImportError: app = FastAPI(title="Markdown Server", docs_url=None, redoc_url=None) # Define the HTML template for rendering markdown +# Using double curly braces to escape them in the CSS HTML_TEMPLATE = """ @@ -36,65 +37,65 @@ HTML_TEMPLATE = """ {title} @@ -151,7 +152,7 @@ async def root(request: Request): Bot Legal Documents