From 956557242da8d1af62442e81b8b37e59b96bad81 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 19 Dec 2024 12:26:23 -0500 Subject: [PATCH] Fix table error --- marker/renderers/markdown.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/marker/renderers/markdown.py b/marker/renderers/markdown.py index 0cadaf16..91cc213b 100644 --- a/marker/renderers/markdown.py +++ b/marker/renderers/markdown.py @@ -43,6 +43,15 @@ def convert_p(self, el, text, *args): return f"{text}" return f"{text}\n\n" if text else "" # default convert_p behavior + def convert_td(self, el, text, convert_as_inline): + text = text.replace("|", " ").replace("\n", " ") + return super().convert_td(el, text, convert_as_inline) + + def convert_th(self, el, text, convert_as_inline): + text = text.replace("|", " ").replace("\n", " ") + return super().convert_th(el, text, convert_as_inline) + + class MarkdownOutput(BaseModel): markdown: str