hey, i have found that the P tags are not truly empty... they have a non-breaking space... so this code would actually kill the paragraph tags left stranded by the insert macro into RTE issue...
$("p").each(function() { var $this = $(this); if ($this.html() === " ") { $this.remove(); } });
My thoughts are that you should only be using jQuery/javascript to enhance the user experience and functionality. This can easily be resolved on the server side without having to bog down the users browser with extra javascript calls.
Go to "tinyMceConfig.config" file under "config" folder.
Search for or go to "<customConfig>" section.
Add new line as: <config key="forced_root_block"></config>
This will not generate <p> tag in CMS Editor. So, you can write your content as you like. :) If you want to change it to something else then change it accordingly. For e.g. If you want to use <div> tag then change it to: <config key="forced_root_block">div</config>
Remove empty paragraph tags in tinymce
When my customer uses a tinymce editor in the backend of Umbraco, sometime empty paragraph lines are generated like <p> </p>
This results in the fact that there is a lot of white space on the page.
Is there a way to automatically get rid of these empty paragraph tags when the node is saved?
if you are using jquery in your site, you can use this in your doc.ready section...
Hi,
You should change settings for validElements in tinyMceConfig.config, look for #p in the file and change it to -p.
This link will explain the different characters meaning.
hey, i have found that the P tags are not truly empty... they have a non-breaking space... so this code would actually kill the paragraph tags left stranded by the insert macro into RTE issue...
A server-side solution is:
Via: http://stackoverflow.com/questions/4408058/how-to-remove-blank-pnbsp-p-tags-at-end-of-paragraph
I think the approach on the following page is better than using jQuery/javascript:
http://our.umbraco.org/forum/using/ui-questions/6266-Empty-p-tag-when-inserting-macro-into-text-editor
My thoughts are that you should only be using jQuery/javascript to enhance the user experience and functionality. This can easily be resolved on the server side without having to bog down the users browser with extra javascript calls.
You guys can easly do it using TinyMCE settings.
This will not generate <p> tag in CMS Editor. So, you can write your content as you like. :) If you want to change it to something else then change it accordingly. For e.g. If you want to use <div> tag then change it to: <config key="forced_root_block">div</config>
Thanks,
Bipin
7.7.1 - won't work ?
It seems that you need to add
for it to work.
Leaving it empty doesn't work for me in 7.7.2.
is working on a reply...