You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've used your lib in my project but had two issues. HTML was not escaped (content was cut on first HTML tag as it was rendered by the browser) and the new lines were not preserved.
Here is my solution - maybe you would like to introduce this fix in the main repo:
In EmojiArea_WYSIWYG function I've changed var html = this.$editor.text();
to var html = this.$editor.html();
to preserve content when sharp parenthesis are used (mostly HTML).
Now, as we switch here from <textarea> to content editable <div>, new lines must be presented in HTML to be saved, hence additional line just under the previous one: html = html.replace(/\n/g, '<br>');
Hope it helps.
Cheers
The text was updated successfully, but these errors were encountered:
Hi there
I've used your lib in my project but had two issues. HTML was not escaped (content was cut on first HTML tag as it was rendered by the browser) and the new lines were not preserved.
Here is my solution - maybe you would like to introduce this fix in the main repo:
In
EmojiArea_WYSIWYG
function I've changedvar html = this.$editor.text();
to
var html = this.$editor.html();
to preserve content when sharp parenthesis are used (mostly HTML).
Now, as we switch here from
<textarea>
to content editable<div>
, new lines must be presented in HTML to be saved, hence additional line just under the previous one:html = html.replace(/\n/g, '<br>');
Hope it helps.
Cheers
The text was updated successfully, but these errors were encountered: