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

@@ -264,6 +264,8 @@ class MarkdownConverter(object):
return '\n\n%s\n%s\n\n' % (text, pad_char * len(text)) if text else ''
def convert_a(self, el, text, convert_as_inline):
if el.find_parent(['pre', 'code', 'kbd', 'samp']):
return text
prefix, suffix, text = chomp(text)
if not text:
return ''