From 2c722f1d1f3cb4b45174c73f1193278720b0847a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 26 Sep 2026 22:52:30 +0100 Subject: Escape markdown image alt text and src --- mammoth/writers/markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mammoth/writers') diff --git a/mammoth/writers/markdown.py b/mammoth/writers/markdown.py index 5c69876..79779de 100644 --- a/mammoth/writers/markdown.py +++ b/mammoth/writers/markdown.py @@ -72,7 +72,7 @@ def _image(attributes, markdown_state): src = attributes.get("src", "") alt_text = attributes.get("alt", "") if src or alt_text: - return _WriterOutput("![{0}]({1})".format(alt_text, src), "") + return _WriterOutput("![{0}]({1})".format(_escape_markdown(alt_text), _escape_markdown(src)), "") else: return _default_output -- cgit v1.2.3