• Resolved Brian Worley

    (@brian-worley)


    Odd additional <p>
    </p> codes are inserted after block elements, e.g. DIV, H1…H6, P etc.

    I’m testing out 3.0.11 prior to installing on several live sites.

    In the old 2.4 it was possible to use block level tags like headings in the codes and there was no additional <p>
    </p> wrapped around following elements. Now as soon as a block level element is used they are added. Additionally even if block level elements were inside conditional tags, the extra <p>
    <p> is shown even if the condition is not met.

    As an example, say I want to treat single day and multi-day events differently, e.g. a start date only for single day and a start and end date for multi-day events.

    In the event I previously used code like this

    [if-multi-day]<h5>[start-date] - [end-date]</h5>[/if-multi-day][if-single-day]<h5>[start-date]</h5>[/if-single-day]

    The trouble is that if the event is a single day I’m getting an additional <p>
    </p>from the multi-day messing with the spacing of a single day, and vice versa for multi-day events.

    https://www.ads-software.com/plugins/google-calendar-events/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Nick Young

    (@nickyoung87)

    Just out of curiosity, do you have line breaks in the editor between the different tags like:

    [if-multi-day][title][/if-multi-day]
    [when]

    I noticed recently that the editor seems to be picking up those line breaks the WP style and injecting tags for them. We are currently discussing a strategy to stop that from happening.

    Thread Starter Brian Worley

    (@brian-worley)

    Hi Nick,

    As far as I know I don’t have extra line breaks in the code. I went and removed all the possible ones I could find, even deleting the characters either side of possible line breaks and re-typing them in. I think my code is actually a single line without any breaks.

    Also if I change the <h5> </h5> wrapped around the elements to <span> </span> tags the additional <p> <br /> </p> doesn’t happen.

    Related to this is the fact that if you use a <h4> </h4> around the first element in the editor – as I had in the past – then there is a <p> <br /></p> inserted before it. So you get the square bullet point with a blank line followed by the event title wrapped in a <h4> tag. Of course I can remove the bullet point with CSS, but the blank line I can’t.

    I am not sure if this is a WP editor or Simple Calendar issue, but either way it’s frustrating. The test site is working with WP4.4 and Simple Calendar 3.0.11

    Thread Starter Brian Worley

    (@brian-worley)

    To add… I just checked in the database with phpMyAdmin for the calendar entry. It does not show any additional tags or hidden CR/LF type codes.

    Plugin Contributor Nick Young

    (@nickyoung87)

    Does it do the same thing when installed on a default theme? Maybe try running through this to see if there are any possible conflicts just to be sure:

    https://docs.simplecalendar.io/troubleshooting-theme-plugin-widget-conflicts/

    Thread Starter Brian Worley

    (@brian-worley)

    Think I’m getting there.

    I switched to the standard WP 2012 theme, deactivated all plugins except Simple Calendar 3.0.11 – still the results were the same with extra <p> <br /> </p> tags around certain elements. So I did some more testing, and found a different behaviour of the conditional tags – or a different treatment of them by WP or the plugin.

    In the past I would have a code like this below with no line breaks or returns

    [if-multi-day]<h4>[start-date] - [end-date]</h4>[/if-multi-day][if-single-day]<h4>[start-date]</h4>[/if-single-day][if-description]<h5>[description]</h5>[/if-description]

    However if I change to code like this below

    <h4>[if-multi-day][start-date] - [end-date][/if-multi-day][if-single-day][start-date][/if-single-day] </h4><h5>[if-description][description][/if-description]</h5>

    It does seem to improve things. It is as if the conditional test being false will result in the output of an extra set of <p><br /></p> tags before the heading tags. However it does result in a blank <h5> </h5> appearing in the output when there is no event description. Whereas in the past I would get no tags using my original formatting with the heading tag inside the conditional test.

    Plugin Contributor Nick Young

    (@nickyoung87)

    Ok thanks for the additional info. I am going to look into the code a bit more to see if maybe there is something I missed that might be trying to add these.

    Plugin Contributor Nick Young

    (@nickyoung87)

    There will be changes concerning this in 3.0.13.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Extra and tags after block elements’ is closed to new replies.