We have moved to GitHub Issues
Created by Marc Kristensen 11 Aug 2014, 12:12:05 Updated by Kamila Mielczarek 23 Feb 2018, 11:04:32
Is duplicated by: U4-4356
Is duplicated by: U4-4815
Relates to: U4-8543
Relates to: U4-4085
Sometimes the rich text editor in umbraco 7.1.1 inserts extra blank p tags between other p tags. It usually happens when: 1 inserting macro in rte. 2 saving and publishing. 3 changing some of the text followed by a save and publish.
It happens quite randomly. I tried just with text, no problems. But when i insert a macro it usually inserts the extra p-tags, resulting in extra line changes.
Forgot to mention, browser and version. Chrome version 36.0.1985.125 m Firefox version 31.0
We've got the exact same issue. In our case it happens when we're editing a macro. This macro has multiple content pickers, once we empty the value in one of the content pickers the
tags show up (not always).
Umbraco 7.1.4 Chrome 37.0.2062.120 m
Our customers are reporting this issue too in 7.1.6. The only consistent way to reproduce is when text and a macro is inserted in the RTE and you hit save and publish it adds extra
's. When you hit save and publish again it duplicates the
The same here. After inserting a macro and hitting save and publish everything looks fine. But when some text is added and save and publish is hit again, it dublicates the existing
's. After removing them and hitting save and publish again.... the
's come back again in double amounts!
Any update on this issue? Our clients are having this issue and it hurts their experience.
Having the same issue in the 7.1.8 release.
Has this been fixed? Ok reproduced it
Anyone tested this in 7.2.0?
hi Tommy - yes still an issue in 7.2.1
I also had this issue a while back and a bit of Googling turned up a solution for this that involved editing the tinyMceConfig.config file in the Configs directory of your site.
The default setting for p tags is: #p[id|style|dir|class|align]. Try replacing the pound symbol with a dash like so: -p[id|style|dir|class|align]. According to the TinyMCE [http://www.tinymce.com/wiki.php/Configuration:valid_elements valid_elements doc], the pound symbol will fill empty elements with padding ( ), whereas the dash will simply remove empty elements.
thanks for that info, Matthew. Core team - should this be an update to the main repo?
I can confirm the solution @Matthew suggested works.
I'm having this issue in 7.2.2 but it only seems to happen when a macro is edited. When the macro is added to the RTE no empty paragraphs are added, the first time it is edited is the same. However each subsequent time the macro is edited empty paragraphs are added to the content.
Matthew's solution didn't seem to work for me.
Also affected in version 7.2.8. I've a macro and some text. Macro has some parameters, a textbox and a content picker. After saved and published, going back to edit the page and edit the macro. Save and publish the page results in adding empty
to the source.
Also suffering this bug with version 7.2.8. If I make two consecutive "save and publish", multiple empty p tags are added to the source.
Same issue here, again related to editing a Macro and saving again afterwards.
@suzyb Same issue here, again related to editing a Macro and saving again afterwards. Occurs in V7.2.4.
Also experience the same problem. Hope to get a fix soon.
Same issue here. Has this been fixed in 7.3+? @Matthew solution doesn't work for me :(
We've noticed this in 7.3.1, and have had a number of clients on various versions of 7 mention it to us.
Seeing this problem in 7.3.3 with Chrome 47. It doesn't matter if I have macros or not on the page.
I changed my TinyMCE config to strip out empty P tags and they're still being created, at least when macros are involved.
Try adding this to your
I can also confirm this issue using 7.3.4. Happens to us only in combination with a macro and if two empty paragraph tags exists anywhere inside the editor. This is a major issue for our client. Please fix this Umbraco team. Also, tried the above fixes with no success.
@bitmapped, what config change did you make to strip out empty P tags. Is that an even that's fired on "Save"? Thanks!
Additional note: the change from Matthew, changing #p to -p is working ok for me. I forgot to recycle my app pool to see the new change. Thanks!
@Hannes I changed to -p in the allowed tags in the TinyMCE config file. I don't know if the code is firing or not but it wasn't working.
@bitmapped yes, did does now. Thanks for the speedy response!
I can confirm the same issue with 7.4.1. This really needs to be prioritized, it's gone on way too long without a permanent fix.
@ProNotion's solution seems to work, the problem with
#p that it also removes empty p tags that people want to put there (a blank line is sometimes desirable).
Commit made by '''Sebastiaan Janssen''' on ''2016-03-12T12:58:53+01:00'' https://github.com/umbraco/Umbraco-CMS/commit/9ad3b6a337e0d87dbd0d5d6388d7e97aaf4e47e5
U4-5334 Richtext editor inserts extra p - tags to html output
To test (even before 7.4.2 is released): add the config in tinyMce.config and make sure to recycle your application pool after applying it. If debug mode is false in web.config, then also make sure to update ClientDependency.config with a new version number (just make it 1 higher or lower) in order for browser cache to be cleared.
@sebastiaan Thanks for taking care of this. I agree that empty
tags used as extra line breaks can be useful in the RTE environment, so I wouldn't want them stripped out either. Is there nothing in between #p and -p? Seems strange there isn't an option for the RTE to just leave it alone by default (neither # nor -) instead of assuming we want or don't want extra
It just leaves them alone with the forced_root_block setting
Turning off forced_root_block has some side-effects though. An example: copy/paste something like this into an empty editor:
Press enter a few time to add more paragraphs and you will see something like this:
Using the remove formatting button leaves you with this:
And since divs lack the styling if p elements this will not look good in a browser.
Okay, I'll revert and leave this open then, don't know what to do about this. People can manually apply the forced_root_block if they want.
And for the people asking for a fix: we have no other idea how to fix this properly, we're open to ideas that don't have weird side-effects.
Hmm, well the problem is only there if a macro is inserted in the RTE (at least for me and a few others in this thread). If I go into Code Mirror and remove the HTML code referencing the macro then everything returns to normal. Could it be something in that macro code interfering with TinyMCE doing its root_block thing? I wouldn't expect so as the macro is wrapped in a
The biggest issue is that empty
tags keep multiplying every time a change is made in the editor then Saved/Published (again, only if a macro is embedded), which is definitely something that needs to be addressed sooner or later. We appreciate your efforts so far to eradicate this issue. I see now why it's been on the bug list for so long.
This happened to me when adding a table in code mirror. The empty
tag shows up above the table every time I save and publish. Deleting the tag and re-saving causes the tag to pop right back in there. Like Poe's Tell-Tale Heart, the tag follows me wherever I go... What did I do to deserve this?
Fixes in http://issues.umbraco.org/issue/U4-8543 may resolve these issues as a script level. I have done some testing in Chrome with Div and Embedded Macro's and am not having extra P's now.
After a lot of trial and error (mainly error) I discovered that if you view the RTE in HTML mode, remove the extraneous p tags and then place the cursor immediately inside any tag (i.e. immediately to the right of the >, not in the attribute bit), it won't add the extra p. The extra p tags seem to be added only if you leave the cursor outside of a tag container.
Any updates on this issue? Recently I experienced this as well. Chrome 54.0.2840.99; Umbraco 7.5.6
@firstname.lastname@example.org You're definitely on to something here, and I'm able to duplicate in 7.5.6. This happens regardless of whether a macro is inserted in the RTE. The issue you describe is similar to something else I reported a while back ([U4-8044|http://issues.umbraco.org/issue/U4-8044]) where it was inserting junk code if the cursor was inside an element tag. It seems the extra tags are dependent on where the cursor is in HTML mode.
I have observed the following scenarios when placing the cursor in HTML mode then saving:
Cursor inside a block (
|) - all is well, cursor stays in place Cursor inside a tag (<p|>) - all is well, cursor moved to the first element on the page, strange but of no consequence Cursor outside any block (|) - adds an extra set of tags at the cursor's location.
So the current workaround is to check HTML mode in the RTE editor and make sure the cursor is inside a block element before saving/publishing, definitely annoying but it guarantees your code will stay as is. Don't know if that analysis helps our Umbraco dev friends, but at least the culprit could be narrowed down.
Just chipping in that this also happens on Preview or Save (not only Save and Publish) and not just when editing a macro. If the RTE contains a macro and I hit the Preview button, then when I close the preview window, the RTE has been "enhanced" with empty paragraphs...
Umbraco can also remove the
again. After random times 'save and publish'.
The randomare added by Umbraco in Chrome, Firefox and IE.
still in 7.6.5
Umbraco 7.7.6 does this too - RTE with macros, Save it and there you go. Extra p tags everywhere. Thankfully, we're stripping them when rendering in frontend, but looks horrible to the editor who thinks Umbraco just threw up on their content.
Sampe problem with v7.5.14 as well. Any fix found?
I've encountered the same issue in 7.8.1. Any workarounds?
Backwards Compatible: True
Affected versions: 7.1.4, 7.2.4, 7.2.8, 7.3.1, 7.3.3, 7.3.4, 7.4.1, 7.3.5, 7.5.6, 7.5.14, 7.6.5, 7.7.6, 7.8.1
Due in version: