• Resolved jaggerwarellc

    (@jaggerwarellc)


    Hi,

    I am using a plugin that allows me to put a short code into my image caption for that plugins feature.

    When I insert an image into my article that includes one of these short codes, the WP Tooltip Glossary plugin is removing white space from between the following paragraph. In other words, I have paragraph 1, at the beginning of that paragraph I insert an image. I update the Image Caption with a short code. I have sentences in that paragraph. Then, I start a new paragraph 2 after the first paragraph with the image at the beginning. There is usually a blank line (or some white space) between two paragraphs. In this instance the white space between paragraph 1 and paragraph 2 is removed.

    I have isolated this to the WP Tooltip plugin. When I only remove the WP Tooltip Glossary plugin, the white space is restored. When I change the short code to be a short code for a different plugin, with WP Tooltip Glossary still activated, the white space is removed.

    I have created an example towards the end of one page on my web site for investigation. The URL is:

    https://www.dakotasays.net/low-residue-dog-food/

    Search this page for “Testing”. On that page you will see three paragraphs. The spacing that exists between paragraph 2 and 3 should also exist between paragraphs 1 and 2. If I deactivate the WP Tooltip Glossary plugin, the white space reappears. If I remove the short code, the white space reappears.

    Above this example in this same URL, you can see where I have a short code that adds a button below the product image. For the testing scenario, I am using the short code “[break]” in the image Caption. This also causes the problem where the white space is removed by the WP Tooltip Glossary plugin.

    Let me know if you have any questions or want me to test or try anything.

    Regards,
    Jagger

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author CreativeMindsSolutions

    (@creativemindssolutions)

    Hi Jagger,

    Thank you for an elaborate question. It seems like there’s a problem with the parsing of the wp caption element in some rare cases. Although we weren’t able to replicate it, we’ve decided to add the code which should stop the captions from being parsed.

    The change will be added in the version 3.4.5

    Best,
    CM Plugins

    Thread Starter jaggerwarellc

    (@jaggerwarellc)

    Hi,

    I have upgraded to version 3.5.0 of the plugin. But, I don’t see an improvement.

    Let me know if there is anything I can do to help debug this issue.

    Regards,
    Jagger

    Plugin Author CreativeMindsSolutions

    (@creativemindssolutions)

    Hi,

    Sorry to hear it didn’t solve your problem. Could you try to wrap the whole content of the page with the [glossary_exclude] shortcode? If this solves your issue it would mean that the problem is caused by the HTML outputted by the parser.

    Best,
    CM Plugins

    Thread Starter jaggerwarellc

    (@jaggerwarellc)

    Hi,

    I think I did what you asked.

    What I did was put ‘[glossary_exclude’ at the beginning of my page. And, then ‘]’ at the end.

    Was this what you wanted?

    When I did that, the earlier places where I put images with short codes seems to work correctly.

    However, the places where I put the ‘[break]’ short code made everything after the image be centered under the image. I’ve left the link up so you can see (see my first post above).

    Let me know if there is anything else you want me to test.

    Regards,
    Jagger

    Plugin Author CreativeMindsSolutions

    (@creativemindssolutions)

    Hi Jagger,

    Yes, that’s exactly what I meant. And the results suggest that the problem is probably coming from the unclosed HTML tag somewhere on the page (probably around the problematic caption).

    The results of the HTML validation indicate that there’s an unclosed div indeed: https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.dakotasays.net%2Flow-residue-dog-food%2F

    Our parser needs the valid HTML to work correcly otherwise it tries to correct HTML itself by closing the tags. Fixing the HTML should resolve the issue.

    Best,
    CM Plugins

    Thread Starter jaggerwarellc

    (@jaggerwarellc)

    Hmm…

    When I disable the WP Glossary, the “div” error went away.

    I have disable all plugins, and I see these errors only in the places where I put a “short code” (text with brackets).

    I have created two Testing sections. One with a short code “[break] in the Caption. And, the second with “Break” (no brackets) in the Caption.

    The first instance puts an additional <p> image stuff </p> around the image AND the first line.

    The second instance does not put the extra <p></p> And this makes the first line separate from the image.

    I guess this is a WordPress issue?

    Regards,
    Jagger

    Thread Starter jaggerwarellc

    (@jaggerwarellc)

    I meant to cut and paste the error I was talking about when all plugins were Disabled:

    Error: No p element in scope but a p end tag seen.
    From line 183, column 997; to line 183, column 1000
    ts remain.</p>?<p>Bl

    I see those errors on the HTML Checker site. I don’t really understand why it reports this as an error. There is a beginning <p> in the HTML.

    With all of the plugins off, I was able to toggle between the WP Glossary plugin being Enabled. And, it being disabled. When I see in the HTML is this:

    With WP Glossary Disabled, the lines are output correctly in the browser (meaning this issue doesn’t occur). The HTML looks like the following for my “Testing” part of the HTML:

    <h3>Testing, Testing, Testing…</h3>?
    <p><div style=”width: 230px” class=”wp-caption alignright”>Testing<p class=”wp-caption-text”>[break]</p></div>Paragraph 1. Sentence 21. Sentence 2.</p>?
    <p>Paragraph 2. Sentence 1. Sentence 2.</p>?
    <p>Paragraph 3. Sentence 1. Sentence 2.</p>?
    <h3>Testing2</h3>?
    <div style=”width: 177px” class=”wp-caption alignnone”>Testing Alt2<p class=”wp-caption-text”>Break</p></div>?
    <p>Paragraph 1. Sentence 1. Sentence 2.</p>?
    <p>Paragraph 2. Sentence 1. Sentence 2.</p>?
    <p>Paragraph 3. Sentence 1. Sentence2.</p>?

    When all I do is Enable WP Glossary, the lines are not output correctly. And, the HTML looks like:

    <h3>Testing, Testing, Testing…</h3>?
    <p></p><div style=”width: 230px” class=”wp-caption alignright”>Testing<p class=”wp-caption-text”>[break]</p></div>Paragraph 1. Sentence 22.  Sentence 2.?
    <p>Paragraph 2. Sentence 1. Sentence 2.</p>?
    <p>Paragraph 3. Sentence 1. Sentence 2.</p>?
    <h3>Testing2</h3>?
    <div style=”width: 177px” class=”wp-caption alignnone”>Testing Alt2<p class=”wp-caption-text”>Break</p></div>?
    <p>Paragraph 1. Sentence 1. Sentence 2.</p>?
    <p>Paragraph 2. Sentence 1. Sentence 2.</p>?
    <p>Paragraph 3. Sentence 1. Sentence2.</p>?

    It seems like the order of tags has been changed by the WP Glossary plugin.

    Regards,
    Jagger

    Plugin Author CreativeMindsSolutions

    (@creativemindssolutions)

    Hi,

    Yes, it seems like the parser doesn’t cope well with the paragraph containing the div and other paragraph. Unfortunately it’s a built-in PHP function and I can’t do anything about it.

    But from what I know this is the HTML4 way of displaying the captions. And in HTML5 there are no problems.

    Best,
    CM Plugin

    Thread Starter jaggerwarellc

    (@jaggerwarellc)

    Thank you for looking into this.

    One thing I’m not completely understanding here about your response is why you can’t do anything about it.

    When I Deactivate the WP Glossary plugin, the parsing works fine. When I Reactivate the WP Glossary plugin, the problem re-occurs.

    Are you saying you are required to use this HTML4 PHP function?

    Or, is there something in my theme or something that is forcing you to use the HTML4 function call?

    Regards,
    Jagger

    Plugin Author CreativeMindsSolutions

    (@creativemindssolutions)

    It means that the plugin is using a function based on PHP that is responsible for the parsing so we have no control on it’s behavior as this is a basic PHP function

    Thread Starter jaggerwarellc

    (@jaggerwarellc)

    That’s disappointing.

    I do believe this didn’t used to occur. And, may have been introduced some time around WordPress 4.7 (at least when I upgraded to 4.7).

    Did your plugin start to use this PHP function around that time?

    Do you have older versions of your plugin available online? I’d like to play with using them if that’s possible.

    Thank you for taking the time to look into this issue. I really appreciate you following up with me and for responding to my questions.

    Regards,
    Jagger

    Plugin Author CreativeMindsSolutions

    (@creativemindssolutions)

    You can find old version in WordPress repository https://wpcrux.com/wordpress-plugin-older-versions/

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘WP Tooltip Glossary removing white space for images with short code.’ is closed to new replies.