mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-16 12:40:18 +00:00
test: add regression test for pipe inside inline code in renderMd tables
This commit is contained in:
@@ -242,6 +242,25 @@ class TestCommonLLMShapes:
|
||||
assert "<p><table" not in out
|
||||
assert "</table></p>" not in out
|
||||
|
||||
def test_table_pipe_inside_inline_code_is_protected(self, driver_path):
|
||||
"""Pipes inside backtick code in table cells must not create extra columns."""
|
||||
src = (
|
||||
"| field | expr |\n"
|
||||
"| --- | --- |\n"
|
||||
"| set | `updates.model = modelState.model || null` |\n"
|
||||
)
|
||||
out = _render(driver_path, src)
|
||||
# Must be exactly 2 cells in the data row
|
||||
assert "<th>field</th>" in out
|
||||
assert "<th>expr</th>" in out
|
||||
# The code cell should contain both pipes
|
||||
assert "<code>" in out
|
||||
assert "||" in out
|
||||
# Must NOT split into extra cells
|
||||
assert out.count("<td>") == 2, (
|
||||
f"Expected exactly 2 <td> cells, got {out.count('<td>')}: {out!r}"
|
||||
)
|
||||
|
||||
def test_strikethrough_outside_quote(self, driver_path):
|
||||
out = _render(driver_path, "This was ~~outdated~~ but is now fine.")
|
||||
assert "<del>outdated</del>" in out
|
||||
|
||||
Reference in New Issue
Block a user