StevenDevooght / tinyMCE-mention

Mention/Autocomplete plugin for tinyMCE WYSIWYG editor.
http://stevendevooght.github.io/tinyMCE-mention/
220 stars 95 forks source link

Issue with Insert function #81

Open Liahus3003 opened 4 years ago

Liahus3003 commented 4 years ago

I have been trying to provide support for RTL languages in my application, so whenever I type ${name} in directionality RTL it gets changed to {name}$, this should not happen for me. Therefore I have been using the following format :

insert: function(item) { return "<span dir='ltr'>" + item.placeholder + "</span>"; },

while this works for my case with single placeholder, when I select multiple mentions like ${firstName} ${lastName} the format : <span dir='ltr'>${firstName} <span dir='ltr'>${lastName}</span></span>

As you can see from the above example the second span is added inside the first span, this behavior is not my expected one. It should be like

<span dir='ltr'>${firstName}</span> <span dir='ltr'>${lastName}</span>

Is there a way that I can achieve this ?