Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emojiarea breaks HTML and new lines [fix attached] #13

Open
Marooned-MB opened this issue Dec 1, 2014 · 1 comment
Open

emojiarea breaks HTML and new lines [fix attached] #13

Marooned-MB opened this issue Dec 1, 2014 · 1 comment

Comments

@Marooned-MB
Copy link

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 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

@azharuniverse
Copy link

Thank you @Marooned-MB I was looking for same solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants