From 0485ff20e8b7abbd4fba24a5993eed3c11dfa946 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 23 Jan 2025 06:21:40 -0800 Subject: [PATCH] Workaround for convert_to_markdown bug --- modules/html_generator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/html_generator.py b/modules/html_generator.py index c836f663..3edbef5e 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -154,6 +154,8 @@ def add_long_list_class(html): @functools.lru_cache(maxsize=None) def convert_to_markdown(string): + if not string: + return "" # Make \[ \] LaTeX equations inline pattern = r'^\s*\\\[\s*\n([\s\S]*?)\n\s*\\\]\s*$'