-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
End Of Line char translate to <p> or <br> #54
Comments
Sounds cool, do you want to commit that and open a PR or should I just do it? 👍 |
Cool. Let's play by the rule, I'll submit a PR tomorrow. |
What I just did -- #55 -- I believe solves this. Although it's a split based way of doing it vs replace. |
Yeah, #55 is the same fix. Good job, there is no need for a duplicate. |
Thanks, guys! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've noticed that the behaviour is not the same when I type a bunch of paragraphs and when I paste the same content (using
forcePlainText
).Typing:
Pasting:
I think it would be better to have the same behaviour.
To create
<p>
instead of<br>
while pasting, the change would be:document.execCommand('insertHTML', false, e.clipboardData.getData('text/plain').replace(/[\r\n]/g, '<br>'));
becomes
document.execCommand('insertHTML', false, '<p>' + e.clipboardData.getData('text/plain').replace(/[\r\n]/g, '</p><p>') + '</p>');
Jeff
The text was updated successfully, but these errors were encountered: