StevenDevooght / tinyMCE-mention

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

additional text remains inside `insert` return #85

Open charlieford opened 3 years ago

charlieford commented 3 years ago

Hey,

This is such a great plugin to have, I've just implemented it but am having a small issue;

I use this to format my text:

insert: function(item) {
    return '<span class="mention" id="' + item.sequence + '">@' + item.name + '</span>';
},

The issue is, that when I continue typing after selecting from the dropdown, the rest of my text continues inside the span tag.

divijc commented 1 year ago

pushing &nbsp; after the closing of the span does the trick insert: function(item) { return '<span class="mention" id="' + item.sequence + '">@' + item.name + '</span>&nbsp;'; },