do not construct Markdown links in code spans and code blocks

Signed-off-by: chrispy <chrispy@synopsys.com>
This commit is contained in:
chrispy
2024-12-29 12:33:46 -05:00
parent 6258f5c38b
commit 71e1471e18
2 changed files with 7 additions and 0 deletions

View File

@@ -39,6 +39,11 @@ def test_a_no_autolinks():
assert md('<a href="https://google.com">https://google.com</a>', autolinks=False) == '[https://google.com](https://google.com)'
def test_a_in_code():
assert md('<code><a href="https://google.com">Google</a></code>') == '`Google`'
assert md('<pre><a href="https://google.com">Google</a></pre>') == '\n```\nGoogle\n```\n'
def test_b():
assert md('<b>Hello</b>') == '**Hello**'