fix: 破损 HTML 表格扫描失败关闭
This commit is contained in:
@@ -23,6 +23,7 @@ def test_expands_rows_without_changing_tags_attributes_or_cells() -> None:
|
||||
"</table>\nafter"
|
||||
)
|
||||
assert len(result.changes) == 1
|
||||
assert result.modifiers[0].version == "1.0.1"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("line_ending", ["\n", "\r\n", "\r"])
|
||||
@@ -56,6 +57,21 @@ def test_mixed_multiline_or_non_strict_tables_are_preserved(markdown: str) -> No
|
||||
assert transform(markdown).output_markdown == markdown
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"markdown",
|
||||
[
|
||||
"<table>broken<table><tr><td>A</td></tr></table>",
|
||||
"<table broken <table><tr><td>A</td></tr></table>",
|
||||
],
|
||||
)
|
||||
def test_damaged_outer_table_does_not_expose_complete_inner_table(markdown: str) -> None:
|
||||
result = transform(markdown)
|
||||
|
||||
assert result.status is RunStatus.SUCCESS
|
||||
assert result.output_markdown == markdown
|
||||
assert result.changes == ()
|
||||
|
||||
|
||||
def test_successful_output_is_idempotent() -> None:
|
||||
pipeline = Pipeline([html_table_layout()])
|
||||
first = pipeline.transform(TABLE)
|
||||
|
||||
Reference in New Issue
Block a user