Trying to rework the Mentions example to use two curly braces ({{
) instead of an @
symbol for triggering the popup. Would eventually like selected text to render as:
{{R2-D2}}
instead of @R2-D2
.
The issue seems to be that beforeText
is not getting the full word since the line break. For each entered text it's jumping and removing the front bracket, so the replaced regex in beforeMatch (now beforeText.match(/^(\{{2})(\w+)$/)
) is not resolving.
For: like {
beforeText is: like {
For: like {{
beforeText is: like {{
For: like {{R
beforeText is: {R
How can I get beforeText not to jump to removing the first bracket when the first letter is entered? Have tried adding a distance option to .before() options but it's yielding the same result.