Skip to content

Commit

Permalink
Don't generate md links in 'pre' blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Feb 11, 2025
1 parent 4b62506 commit 025812d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/markitdown/src/markitdown/converters/_markdownify.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def convert_a(self, el: Any, text: str, convert_as_inline: bool):
prefix, suffix, text = markdownify.chomp(text) # type: ignore
if not text:
return ""

if el.find_parent("pre") is not None:
return text

href = el.get("href")
title = el.get("title")

Expand Down

0 comments on commit 025812d

Please sign in to comment.