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