Fix: markdown table double extraction in parser (#13892)

### What problem does this PR solve?

Fixes markdown tables being parsed twice (once as markdown and again as
generated HTML), which caused duplicate table chunks in the chunk list
UI.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Idriss Sbaaoui
2026-04-02 13:31:56 +08:00
committed by GitHub
parent 1c2c4b337e
commit dd529137eb
2 changed files with 7 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ class RAGFlowMarkdownParser:
""",
re.VERBOSE,
)
working_text = replace_tables_with_rendered_html(border_table_pattern, tables)
working_text = replace_tables_with_rendered_html(border_table_pattern, tables, render=separate_tables)
# Borderless Markdown table
no_border_table_pattern = re.compile(
@@ -68,7 +68,7 @@ class RAGFlowMarkdownParser:
""",
re.VERBOSE,
)
working_text = replace_tables_with_rendered_html(no_border_table_pattern, tables)
working_text = replace_tables_with_rendered_html(no_border_table_pattern, tables, render=separate_tables)
# Replace any TAGS e.g. <table ...> to <table>
TAGS = ["table", "td", "tr", "th", "tbody", "thead", "div"]