Good point, Wolfgang.

The Markdown is translated to XHTML then typeset as XML using the setups listed here:

https://github.com/DaveJarvis/keenwrite-themes/tree/main/xhtml
Having an XML string replacement solution would be great. I suppose that would help prevent substitutions within pre and code blocks, too, wouldn't it?