This project is read-only.

BodyPart adds <p> around text

Topics: Core, Customizing Orchard, Troubleshooting, Writing themes
Sep 3, 2012 at 4:37 PM
Edited Sep 3, 2012 at 4:39 PM

Is there a way to prevent the BodyPart from auto-adding a <p> around any text after saving it.

When I add direct HTML (as source); I expect it to look EXACTLY like it was put there; not have some UI tool auto-generate <p> tags around it.  How can this be turned off?

(this is done by going to anything that uses the BodyPart - using any editor - then add your HTML source; click save; and when you view it again; you'll notice that it added a <p> around it.)

NOTE: if it were just text - that would be fine; but it does this around elements as well;

My body has a <h1>text</h1><a href="#"></a> - and after save; it will surround the <a> with a <p>


Sep 3, 2012 at 6:17 PM

That sounds like a TinyMCE specific thing. If you disable the TinyMCE module you will get a plain text editor in which you can enter html. Does the same thing happen if you do that?

Sep 3, 2012 at 7:37 PM

I diabled all of the editors and got just the text box with HTML; when I edit the text and then save it; it added the <p> tag again.

Since I noticed some of the other(s) were not doing this anymore; I decided to clear it and re-do it and it no longer added the <p>.  I'm using CKEditor now.

Seems to be working.