Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deepdoc/parser/markdown_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def replace_tables_with_rendered_html(pattern, table_list, render=True):
""",
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(
Expand All @@ -68,7 +68,7 @@ def replace_tables_with_rendered_html(pattern, table_list, render=True):
""",
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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#


from time import sleep

import pytest
from common import batch_add_chunks, delete_all_chunks
Expand All @@ -32,6 +31,10 @@ def condition(_dataset: DataSet):
return False
return True

@wait_for(30, 1, "Chunk indexing timeout")
def chunks_visible(_document: Document, _chunk_ids: list[str]):
visible_ids = {chunk.id for chunk in _document.list_chunks(page_size=1000)}
return set(_chunk_ids).issubset(visible_ids)

@pytest.fixture(scope="function")
def add_chunks_func(request: FixtureRequest, add_document: tuple[DataSet, Document]) -> tuple[DataSet, Document, list[Chunk]]:
Expand All @@ -47,6 +50,5 @@ def cleanup():
dataset.async_parse_documents([document.id])
condition(dataset)
chunks = batch_add_chunks(document, 4)
# issues/6487
sleep(1)
chunks_visible(document, [chunk.id for chunk in chunks])
return dataset, document, chunks
Loading