Why EditLive! Inserts Empty P Tags With Non-Breaking Spaces

One of the very common questions customers ask is "Why does EditLive insert an empty paragraph tag with non-breaking space (  or  ) in code view?".  This article addresses the reasons behind this behavior of EditLive!. 

When

  1. When you first load EditLive! without any content in its body
  2. Pressing "Enter" key in the design view of EditLive!

Why

  1. EditLive! assumes user will start typing after the initial load and prepares the editor by placing an empty paragraph at the start of the empty document. This provides a place in the document to actually position the caret and allow the user to start entering text. If the user chooses to insert a heading tag instead of a normal paragraph, EditLive! simply replaces the paragraph with the relevant heading.
  2. Most browsers ignore empty paragraph tags, so to ensure the page displays as the user intended, a non-breaking space is inserted into empty paragraphs.

 

Suneth has spent plenty of time manning the Ephox support desk and is now helping to develop new additions to Ephox's product line up. When he's not at Ephox he's flitting off to fancy resorts around the world.

6 Responses to “Why EditLive! Inserts Empty P Tags With Non-Breaking Spaces”

  1. ty bowman Says:

    We need this feature disabled. In other words, don’t insert a tag or any other tag without my consent. It causes a problem on every single one of our pages by inserting a blank line at the top of each page leaving too much space at the top. The only way to get rid of it is to go into another editor (read not productive) and delete the silly and closing tag. Then how good is your editor if my users don’t use it?

    This is the kind of erroneous thinking that leads software companies to believe we as users want everything automated for us. Take a look at what Microsoft has done to Word. It auto capitalizes, auto corrects things incorrectly, auto inserts spaces, characters, bulleted lists, indents and all kinds of garbage that takes me more time undo and redo the way I wanted it in the first place. Please don’t follow their bad example. I thought you people would be a little more sensible than that. It’s not helping me or my users, that’s for sure.

  2. Adrian Sutton Says:

    Hi Ty,
    I’m not sure why this would cause extra whitespace at the top of your pages. If the user types anything into the document it will use that P tag. I’m sure we can sort out what’s going on in your situation and avoid your users having to switch to another editor. The best way is probably to log a support case (http://www.ephox.com/support/request/) so we can make sure the problem gets tracked properly and gets the attention it deserves. We’re always keen to help out with issues like this so please do get in touch when you have problems - if we don’t know about them we can’t fix them.

    Regards,

    Adrian Sutton.

  3. Wing Tse Says:

    Hi,

    It there any solution to disable it?

    Regards

    Wing

  4. Adrian Sutton Says:

    Hi Wing,
    For the reasons we describe in the article, there isn’t a way to disable this. If you really need to avoid the nbsps for some reason, you could easily filter out

     

    and

     

    on the server side with a simple find/replace.

  5. Ed Wong Says:

    We are having issues with the P tags also. We use WCM and need to append a link on the same line after the user’s content (i.e., using a presentation template). The P tag is forcing the link to the next block. We need to have the P-tags disabled. The users are very upset about this.

  6. Adrian Sutton Says:

    Hi Ed,
    That’s a slightly different issue - this article is particularly about empty p tags, whereas you essentially want content to not be wrapped in p tags at all. You can achieve that by setting the encloseText attribute of the htmlFilter element in your config to false, but we really don’t recommend it.

Leave a Reply