Last active
April 20, 2023 15:42
-
-
Save DuncanWilder/da3ac67ad4ac726d0a63 to your computer and use it in GitHub Desktop.
Pressing enter/return on a contenteditable div places this into the html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contenteditable | |
Pressing enter/return on a contenteditable div places this into the html | |
Fix: http://jakiestfu.github.io/Medium.js/docs/ or http://stackoverflow.com/questions/18552336/prevent-contenteditable-adding-div-on-enter-chrome | |
Firefox: <br> | |
Chrome: <div><br></div> (<div>With text</div>) | |
Safari: <div><br></div> (<div>With text</div>) | |
IE11: <p><br></p> (<p>With text</p>) | |
IE10: <p> </p> (<p>With text</p>) | |
IE9: <p> </p> (<p>With text</p>) | |
IE also places a <p> tag around the prior element if it does not have one. So | |
<div>text</div> | |
becomes | |
<div><p>text</p><p>More text</p></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment