Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

A backslash in edit mode behaves different

Open JWKoppie opened this issue 6 months ago • 3 comments

Just curious, if I have this in my README.md

| Folder\subfolder | Other normal text | | Folder\*.py | Other normal text |

In edit mode The first line Folder\subfolder stays white The second line Folder\*.py is shown in blue

In normal view mode the both lines are shown correctly The difference in edit mode is created by the backslash, but why?

JWKoppie avatar May 08 '26 19:05 JWKoppie

could you upload a screenshot?

alecdotdev avatar May 08 '26 20:05 alecdotdev

See image Image

JWKoppie avatar May 10 '26 11:05 JWKoppie

This is Monaco's bundled Markdown grammar, not something Markpad configures.

Its inline-code rule is \([^\`]|@escapes)+`where@escapesis/\\[\`*_[]{}()#+-.!]/. So *matches@escapes, the code span matches, and you get code colouring; \s` is not a valid Markdown escape, the rule fails to match, and the whole line falls back to plain text.

That matches your report exactly, including the preview being correct — the preview goes through comrak, which follows CommonMark. It's an editor-colouring difference only. Noted in #393 with the other Monaco-defaults items.

PathGao avatar Aug 02 '26 21:08 PathGao