Bug in how user references are handled in Plain Text/Rich Text Editors
There seems to be some anomalies when using our user references (and maybe GitLab references in general?) and converting them back and forth between plain text and RTE. Here's an example video:
What @digitalmoksha saw:
-
When the markdown includes (@digitalmoksha)
, a space gets added after the first parenthesis, giving( @digitalmoksha)
. I first noticed this when creating an entry in a table where we needed to put our user name in parenthesis. Although I added it in markdown, when someone else edited the table using the RTE, my entry was changed to include a leading space. -
The same happens when using double-quotes instead of parentheses. May happen with other surrounding punctuation. -
A \
is used to escape markdown symbols, forcing them to be rendered normally. This is also used for symbols such as@
which normally triggers user reference - adding the\
keeps it from being a reference. Having\@digitalmoksha
in the markdown initially shows correctly in the rte, but going back to markdown removes the leading\
, triggering a user reference. -
Adding \@digitalmoksha
in the rte doesn't escape the character, it's treated literally. So when translated back to markdown it becomes\\@digitalmoksha
-
When entering `@digitalmoksha`
in the RTE (the username surrounded by backquotes to make it an inline code block), hitting Enter then changes it to a normal user reference, removing the backticks.
Here's the original markdown Brett started with:
- (@digitalmoksha)
- "@digitalmoksha"
- `@digitalmoksha`
- \@digitalmoksha
-
Edited by Himanshu Kapoor