Update: It is NOT the bug I first reported. The problem you are seeing is because the Search and Replace "Replace with" field, in your macro, actually has two lines in it:
So, starting from the beginning, using the source text from your https://regex101.com/r/nMlxiS/2 post, I have found the following macro to do generally what you are asking for. However, the text in the final result image you posted does NOT match the source text. So, I'm not sure exactly what you want. But this should at least get you started.
Be careful to NOT paste text into the Search and Replace Action. Be sure to just type it in.
MACRO: Convert Markdown to HTML [Example]
~~~ VER: 1.0 2019-11-01 ~~~
Requires: KM 8.2.4+ macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))
DOWNLOAD Macro File:
Convert Markdown to HTML [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
The second Replace
is there to replace TAB and other characters in this substring:
har Oslo opplevd
with one SPACE.