Closed chiragsatapara closed 7 years ago
Do use ordinary textarea or contenteditable?
I am using a contenteditable @ivirabyan
$('#editable').mentionsInput('getValue'); this value return the data which contain u200B
, so i use this function to remove that. .replace(/[\u200B-\u200D\uFEFF]/g, '')
and now it is working fine , so you have to think on this . @ivirabyan
this character are zero width character . Refer this stackoverflow link click here @ivirabyan
Yes, I know about this character, it's used to identify mentions within text. Of course this shouln't be returned with getValue() call, it's only part of representation, not what actually must be stored.
@ivirabyan, it is return with the getValue() , so i just do below change in my code.
MentionsContenteditable.prototype.getValue = function() {
var markupMention, value;
value = this.input.clone();
markupMention = this._markupMention;
$(this.selector, value).replaceWith(function() {
var name, uid;
uid = $(this).data('mention');
name = $(this).text();
return markupMention({
name: name,
uid: uid
});
});
return value.html().replace(this.marker, '').replace(/[\u200B-\u200D\uFEFF]/g, '');
};
Get Value add some extra character after the mention value , here look the image. Click here , red dot indicate the extra character , it save ? into the database. @ivirabyan