StevenDevooght / tinyMCE-mention

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

Auto suggation box doesn't open if we use BR tag on enter key instead of P tag. #23

Closed masihur closed 9 years ago

masihur commented 9 years ago

Hi, I have used tinyMCE 3.5 version. We use BR tag for enter key instead of P tag (default feature of tinyMCE). In this case if a user press enter key then auto-suggestion box doesn't open on @symbol. Applied a condition into the function o(). After that issue have been fixed. Code as below.

function o() {
    var n = t((e.selection.getNode().outerHTML).replace("<br>","&nbsp;")),
    r = n.text(),
    i = r.substr(r.length - 1, 1);   
    return !!t.trim(i).length ? false : true
}

Please review it and add this into your original library.

StevenDevooght commented 9 years ago

I fixed the prevCharIsSpace function so it also works with force_br_newlines enabled.

The fix is included in the 3.5.0 tag.

masihur commented 9 years ago

Hi, Thank You Steven Devooght.