From 8dd0ce0b69e3987c0b2282bdf1cb2e9f6abaf57d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 26 Sep 2026 22:50:02 +0100 Subject: Escape markdown link hrefs --- mammoth/writers/markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mammoth') diff --git a/mammoth/writers/markdown.py b/mammoth/writers/markdown.py index c78fd3f..5c69876 100644 --- a/mammoth/writers/markdown.py +++ b/mammoth/writers/markdown.py @@ -61,7 +61,7 @@ def _hyperlink(attributes, markdown_state): href = attributes.get("href", "") if href: return _WriterOutput( - "[", "]({0})".format(href), + "[", "]({0})".format(_escape_markdown(href)), anchor_position="before", ) else: -- cgit v1.2.3