Unwanted <p> tags

Last post 07-04-2008, 10:59 AM by GDB. 4 replies.
Sort Posts: Previous Next
  •  07-03-2008, 12:04 PM 41908

    Unwanted <p> tags

    Hello All,

    I was wondering if there was a way to turn off the paragraph tags that seem to arbitrarily surround text.

    Any help would be great.


    Antoszj
    Filed under:
  •  07-03-2008, 12:51 PM 41911 in reply to 41908

    Re: Unwanted <p> tags

    Antoszj,

    It's a behavior of IE.

    When you start editing, <P> or <div> tags will be inserted automatically by IE.
     
    The content is wrapped in the block level element.
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-03-2008, 2:58 PM 41918 in reply to 41911

    Re: Unwanted <p> tags

    Alright, thanks for the tip.
  •  07-04-2008, 10:32 AM 41939 in reply to 41911

    Re: Unwanted <p> tags

    This is an example of some obvious browser compatibility bugs. Will they be fixed?
     
    Here's a comparison of how the two browsers handle Cute entries. Versions IE 7 and Firefox 3
     
    TEST ONE:  BreakElement="P"
     
    IE encloses each line in opening and closing <p> tags
    Firefox does the same
     
    TEST TWO  BreakElement="Br"
    IE encloses the entire block in opening and closing <p> tags but uses <br /> between lines 1 and 2.
    Firefox uses only the <br /> between lines 1 and 2.
     
    Another bug relates to how IE handles the Cute editor background color. It is considered best practise UI design to have data input fields displayed in a different color than the page color. I set this in Cute thusly:  EditorBodyStyle="background-color:#FFFFC0"
     
    Firefox handles this as expected. IE however writes the text to the database with color tags UNLESS  AutoConfigure="None"
     
    Here's the database record when written from the IE browser with  AutoConfigure="Minimal":
    <p><font style="background-color: #ffffc0">Test Two: IE line one using Br<br />Line two</font></p>
  •  07-04-2008, 10:59 AM 41941 in reply to 41939

    Re: Unwanted <p> tags

    Here's some code for getting rid of the unwanted IE <p> tags. It's a bit of a pain but, in my case, necessary. In this example the "Name" string is coming from an Editor control in a details view:
     

    string name_p2 = ((Editor)EventView.FindControl("CeName")).Text;

    // Clean the unwanted <p></p> tags that IE inserts

    string name_p1 = name_p2.Replace("<p>", "");

    string name = name_p1.Replace("</p>", "");

View as RSS news feed in XML