ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

Weird character after mentions #17

Closed charlie-eth closed 9 years ago

charlie-eth commented 9 years ago

I get this character after every mention which I haven't managed to remove d

and it shows as a question mark when I output it:

d

Apparently, it's a character Chrome can't display (see http://stackoverflow.com/questions/23511275/json-response-format-error-red-dot-bullet-before-response)

char var dump returns this: ""

Any thoughts on why this is happening?

ivirabyan commented 9 years ago

This character is used internally to keep track of mentions in textarea. You probably getting textarea's value directly, instead of using methods, which causes such an issue.

charlie-eth commented 9 years ago

Actually, I use getMentions and getValue which returns this de

where content is the raw content of my textarea (which is the string I store in my database).

I guess I'll just do some str_replace on it.

Thanks

ivirabyan commented 9 years ago

You shouldn't be using raw content of the textarea. Use getRawValue instead.

charlie-eth commented 9 years ago

It's not listed as a method so didn't know it was a thing!

That will help, thank you!

ivirabyan commented 9 years ago

I just added it. Your use case is little different from mine, so I didn't have it before

charlie-eth commented 9 years ago

Thank you!