fix: 破损 HTML 表格扫描失败关闭
This commit is contained in:
@@ -23,6 +23,7 @@ def test_unescapes_one_layer_only_in_strict_cell_text() -> None:
|
||||
"\noutside <"
|
||||
)
|
||||
assert len(result.changes) == 3
|
||||
assert result.modifiers[0].version == "1.0.1"
|
||||
|
||||
|
||||
def test_multiple_tables_and_cells_report_source_order() -> None:
|
||||
@@ -47,6 +48,21 @@ def test_non_strict_or_outside_content_is_preserved(markdown: str) -> None:
|
||||
assert transform(markdown).output_markdown == markdown
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"markdown",
|
||||
[
|
||||
"<table>broken<table><tr><td>&lt;</td></tr></table>",
|
||||
"<table broken <table><tr><td>&lt;</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_fenced_table_is_not_protected_by_the_lexical_subset() -> None:
|
||||
markdown = "```html\n<table><tr><td>&lt;</td></tr></table>\n```"
|
||||
assert transform(markdown).output_markdown == "```html\n<table><tr><td><</td></tr></table>\n```"
|
||||
|
||||
Reference in New Issue
Block a user