Fix reference serialization in RTE
What does this MR do and why?
Fix reference serialization in RTE
In rich text editor, we added spaces before a reference to separate references better. But space is not needed in cases like when the reference is enclosed in brackets, or surrouned by quotes or punctuation. Also fixes issues with references inside inline code blocks.
Changelog: fixed
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Create a new wiki page.
- Enter the following markdown test cases in plain text editor:
Reference test cases:
* (@root)
* "@root"
* '@root'
* `@root`
* assigned to:@root
* @root,@root.@root
* \`@root\`
* @root@root
- Switch to rich text editor
- Press space after 4th bullet
`@root`
. A user reference inside an inline code block should not be converted to an actual reference. - Switch back to plain text editor.
The markdown should mostly remain unchanged, except for addition of a space between two users in the last reference test case.
Before | After |
---|---|
|
|
Emoji tests are mostly unchanged, except if you include an emoji in a code block, the code block is not removed.
Related to #436476 (closed)