Return duplicates empty divs
See original GitHub issueWhen you have content wrapped in a <div>, instead of <p>, hitting the Enter Key causes TinyMCE to create a new <div> with the same style and classes.
If you start with this example:
<div class="example">Sample text, put cursor here and hit enter… this part of sentence is moved to a new div</div>
And hit the Enter Key in that sentence you get:
<div class="example" style="padding: 20px;">Sample text, put cursor here and hit enter… </div>
<div class="example" style="padding: 20px;">this part of sentence is moved to a new div</div>
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
How to display empty values after duplication of form
You need to empty the value of input on your clone like this. $(document).ready(function() { var id = 1; // get item var...
Read more >pandas.DataFrame.duplicated — pandas 1.5.2 documentation
Return boolean Series denoting duplicate rows. ... Remove duplicate values from DataFrame. ... To find duplicates on specific column(s), use subset .
Read more >Empty <div>s are rendered [#1049450] | Drupal.org
I'm using this to prevent duplicates caused by second rendering of timezone template.php /** * Cleans up empty DIVs within date.
Read more >• Designing With Empty State Divs - Bugs - Forum | Webflow
I'd like to get some more insight into what's happening here—from the screenshot alone I can't tell quite is happening. There have been...
Read more >600 empty divs disappear - KompoZer Bugs - SourceForge
line 179 of MarkupCleaner.js implies that a div should remain when empty if it has a class or id but it still gets...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have solved the newline issue, by adding an enter-key handler in editor.setup (doesn’t work if implemented anywhere else):
There really should be an option like “always use
<p>or<br>” when they hit enter? It seems like an obvious option to have, especially, given that it was part of 3.x and 4.x, namely: “forced_root_block: p” and “force_p_newlines: true”. Why was this removed and replaced with “br_in_pre” which is far less common… who uses<pre>anyway? https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#br_in_preBUG: The “end_container_on_empty_block” option does not work with nested divs; it skips the immediate block-wrapper and completely removes it’s parent block element. https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#end_container_on_empty_block
Thank you so much @blairzotron ! I wanted to add a div on iframes, to make them responsive with this css trick https://blog.theodo.com/2018/01/responsive-iframes-css-trick/ Was facing the same issue as mentioned. Your workaround saved me!
Still, I would like to reinforce to the team that a definite solution would be great.