ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

div being put inside paragraph by xhtml formatted entry

February 14, 2008 1:39pm

Subscribe [2]
  • #1 / Feb 14, 2008 1:39pm

    nosidam

    9 posts

    So I have an entry that is formatted as xhtml, and for some reason, EE is always wrapping a div inside a paragraph tag, and I thought it wasn’t supposed to do that.

    For example, my entry looks like this:

    Some text
    
    <div class="some-class">somesource</div>
    
    Some more text

    What’s rendered in the output is:

    
    Some text
    
    
    <div class="some-class">somesource</div>
    
    
    Some more text
    

    Now my first question is, am I doing something wrong?  Is there a setting somewhere that I screwed up that tells the xhtml formatter to ignore proper formatting for divs?

    Other than changing the formatting to none and coding the paragraphs myself, is there a way to fix this?

  • #2 / Feb 14, 2008 2:21pm

    Lisa Wess

    20502 posts

    I just tested this on my site, with your exact inputted text, and what gets returned is this:

    Some text
    
    <div class="some-class">somesource</div>
    
    Some more text

    So I can’t replicate this.  Can you let us know what version and build of EE you’re on, and what extensions you’re running?

  • #3 / Feb 14, 2008 2:47pm

    nosidam

    9 posts

    Can you let us know what version and build of EE you’re on, and what extensions you’re running?

    1.6.2 build 20080124

    As far as extensions, I’ve got Akismet Check (v.1.1), Tag Submit (v.2.0.7), and the following plug-ins:

    Word Limiter (v.1.0)
    Subcategories (v.Beta 2)
    HTML Stripper (v.1.0.1)
    Allow PHP (v.1.0)
    Randomizer (v.1.0)
    Magpie RSS Parser (v.1.3.4)
    PHP (v.1.0.0)
    Yearly Archives (v.1.11)
    Character Limiter (v.1.0)
    XML Encode (v.1.2)
    Allow EE Code (v.1.1)

    I’ve tested the test entry in a blank template and it’s doing the same thing.  I looked at the database and the entry has the correct formatting in the database, so it looks like it’s happening as it’s being rendered for output.

  • #4 / Feb 14, 2008 2:49pm

    Lisa Wess

    20502 posts

    Can you post a link to your test template, as well as the entire template code?

  • #5 / Feb 14, 2008 3:11pm

    nosidam

    9 posts

    Can you post a link to your test template, as well as the entire template code?

    I was hoping you wouldn’t ask for that. 😉  It’s on a non-publicly available dev server at the moment.  What I can do is post the code.  I changed it slightly to get everything to the lowest common denominator, but it’s still happening.

    Entry in entry form:

    This is just a test to see if EE puts a div in a paragraph.
    
    <div>This is in a div</div>
    
    Some more text.

    This is the test template:

    <html>
    <body>
    
    {exp:weblog:entries weblog="articles"}
    {content}
    {/exp:weblog:entries}
    
    </body>
    </html>

    This is the output.  The output is the same in IE6/7 and Firefox 2.

    <html>
    <body>
    
    
    This is just a test to see if EE puts a div in a paragraph.
    
    
    <div>This is in a div</div>
    
    
    Some more text.
    
    
    
    </body>
    </html>
  • #6 / Feb 14, 2008 3:16pm

    Lisa Wess

    20502 posts

    What is the formatting type for your content field set to?

  • #7 / Feb 14, 2008 3:27pm

    nosidam

    9 posts

    What is the formatting type for your content field set to?

    It’s definitely Xhtml.

  • #8 / Feb 14, 2008 4:04pm

    Lisa Wess

    20502 posts

    Hrm.  I did just replicate this.  I’ll have to look into this one.

  • #9 / Feb 14, 2008 4:31pm

    nosidam

    9 posts

    Hrm.  I did just replicate this.  I’ll have to look into this one.

    Whew!  I thought I did something to break it.  Thanks.

  • #10 / Feb 18, 2008 11:40am

    Boyink!

    5011 posts

    Nosidam:  First I need to apologize, this issue slipped past me last week and should have been addressed sooner.  That’s my fault entirely - my apologies for that.

    This issue has been logged as a bug.  In the meantime if your content will have a number of different types of markup I’d suggest going with a field formatting of “none” or looking into one of the Markdown/Textile plug-ins.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases