Skip to content

Commit 3a5ca22

Browse files
authored
Don't generate md links in 'pre' blocks (#322)
1 parent 4b62506 commit 3a5ca22

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/markitdown/src/markitdown/converters/_markdownify.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def convert_a(self, el: Any, text: str, convert_as_inline: bool):
3333
prefix, suffix, text = markdownify.chomp(text) # type: ignore
3434
if not text:
3535
return ""
36+
37+
if el.find_parent("pre") is not None:
38+
return text
39+
3640
href = el.get("href")
3741
title = el.get("title")
3842

0 commit comments

Comments
 (0)