• Resolved RussFoster

    (@russfoster)


    I love this tool. Helps automate keeping the site fresh looking.

    One issue I have is, it seems to generate lots of blank lines. I have a large list of events that update every day. At the top of the list are a lot of spurious blank lines. This seems to happen outside of the timerestrict brackets.

    It doesn’t seem to matter what theme I use.

    It may not be a shortcode issue. But my page looks like this (not all of it):

    <h1>X-Files, 201 Days</h1>
    <a href="http://www.fox.com/the-x-files" target="_blank">The X-Files | Latest Buzz</a>
    <a href="http://www.fox.com/article/201-days-of-the-x-files" target="_blank">201 Days of The X-Files | FOX</a>
    Scroll down for 201 days daily updated ticker:
    
    <table>
    <tr>
    <td>countdown</td>
    <td>Episode</td>
    <td>Title</td>
    <td>type</td>
    <td>org air date</td>
    </tr>
    [time-restrict on="2015-7-7"]
    <tr>
    <td>2015-Jul-07 (Tue)</td>
    <td>S1:E1</td>
    <td>Pilot</td>
    <td>mythology</td>
    <td>1993-Sep-10 (Fri)</td>
    </tr>
    [/time-restrict]
    [time-restrict on="2015-7-8"]
    <tr>
    <td>2015-Jul-08 (Wed)</td>
    <td>S1:E2</td>
    <td>Deep Throat</td>
    <td>mythology</td>
    <td>1993-Sep-17 (Fri)</td>
    </tr>

    https://wordpress.org/plugins/shortcodes-to-show-or-hide-content/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dave Clements

    (@thewanderingbrit)

    Hi Russ,

    Looking at the source code of your page, all of these blank lines are showing up before the table even begins, so something else must be adding these blank lines ahead of the table. Here’s a look at the page with the source code visible, showing lots of <br> tags ahead of the table: https://cloudup.com/cx_aj3bY_TV

    Thread Starter RussFoster

    (@russfoster)

    Thanks Dave.

    My code is exactly as posted above, with only a single blank line ahead of the table tag.

    I know WordPress tries to interpret the table tags inside the time-restrict codes regardless of the date values–this is evidenced by switching my view between Visual and Text; as it “re-organizes” all the time-restrict tags and tables tags into something meaningless. I may just need to avoid using a table.

    Plugin Author Dave Clements

    (@thewanderingbrit)

    But I’m not sure that that’s the issue, since the HTML being outputted is <br> tags, not table tags like <tr>, <td> etc. At any rate, avoiding tables is probably a good idea anyway!

    Hi Dave,

    I encountered the same issue of unwanted blank lines on top of my tables when I enclose table rows with [time-restrict] shortcodes in order to schedule their visibility.
    I couldn’t resolve this by programmatically, but when I looked on the generated code, I had an idea : why not find/remove the unwanted markups ? I had a manageable situation for this trick : my scheduled table rows were surrounded by <p> and br/ when they were visible.
    I found these plugins to remove/replace strings : Replace Word and Real-Time Find and Replace. I chose the last one, as it works after generating the page but before its rendering : why not trying ?
    After installation and configuration, scheduling a row, empty cache…
    Everything fine : No more blank lines, table row hidden/showed as wanted ! And in the HTML code, no <br> in my table.
    I know this is a workaround, and it may not be suitable for all situations, but it can help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘lots of blank lines’ is closed to new replies.