From 6a4783afc7c17c7fef7d8275b420105fe60c9587 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 10 May 2023 13:41:23 -0300 Subject: [PATCH] Add markdown table rendering --- modules/html_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/html_generator.py b/modules/html_generator.py index 8fead018..ceb167e0 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -59,7 +59,7 @@ def convert_to_markdown(string): is_code = not is_code result += line - if is_code: + if is_code or line.startswith('|'): # Don't add an extra \n for tables or code result += '\n' else: result += '\n\n' @@ -68,7 +68,7 @@ def convert_to_markdown(string): result = result + '```' # Unfinished code block string = result.strip() - return markdown.markdown(string, extensions=['fenced_code']) + return markdown.markdown(string, extensions=['fenced_code', 'tables']) def generate_basic_html(string):