mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-12 18:50:35 +00:00
25 lines
912 B
Python
25 lines
912 B
Python
pytest_plugins = ("tests.test_renderer_js_behaviour",)
|
|
|
|
from tests.test_renderer_js_behaviour import _render
|
|
|
|
|
|
def test_inline_code_inside_link_label_renders_as_code(driver_path):
|
|
out = _render(driver_path, "[`8c64957`](https://github.com/x/y)")
|
|
assert '<a href="https://github.com/x/y"' in out
|
|
assert "<code>8c64957</code>" in out
|
|
assert "<code>" not in out
|
|
|
|
|
|
def test_list_item_link_label_keeps_inline_code(driver_path):
|
|
out = _render(driver_path, "- [`8c64957`](https://github.com/x/y)")
|
|
assert "<li>" in out
|
|
assert "<code>8c64957</code>" in out
|
|
assert "<code>" not in out
|
|
|
|
|
|
def test_unknown_raw_html_inside_link_label_is_escaped_once(driver_path):
|
|
out = _render(driver_path, "[<script>alert(1)</script>](https://github.com/x/y)")
|
|
assert "<script>" not in out
|
|
assert "<script>alert(1)</script>" in out
|
|
assert "&lt;script" not in out
|