Preview corrupts everything between a link and a later asset extension path (Marked 3.1.15)

Viewed 16

The asset-path rewrite regex (<img src="|](?:(|:\s+))(?!http)([^?"]+?.
(?:jpe?g|gif|png|svg|pdf|webp|avif))(?:?[^"\s]*)? uses a character class that only excludes ? and ".
It therefore matches across newlines and ), so any Markdown link followed later in the document by a bare path ending in an asset extension causes the whole span to be treated as a path, percent-encoded, and substituted back into the source.

Non-ASCII text in that span renders as %E3%81%82-style sequences. Minimal repro (3 lines, any processor, MathJax on or off):

あ[a](README.md)い

参照は `ref/x.pdf` です
2 Answers

Yep, I've alreaedy got this fixed for the next update, which is in review now.

Just confirming this is fixed in 3.1.17.
The affected documents now render correctly.
Thanks for the quick fix!