• Hi!

    There is a problem when Gutenberg editor enabled for popups in plugin’s settings.
    There are paragraphs in the content that are empty but create unneeded margins and more padding to popup. One of them has br inside.

    I’m removing them with this CSS, but please check.

    .pum-content p br, .pum-content p:empty {
      display: none;
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @webprom – How did the extra lines get there? Are they coming from the content editor in a way that they can simply be removed there?

    Thread Starter Webprom Design

    (@webprom)

    Unfortunately, they can’t be removed in editor ?? And each edit adds new lines…

    Plugin Author Daniel Iser

    (@danieliser)

    @webprom – In those cases I’m not sure what can be done on our end. We render the popups content using the exact same filters WP core does to strip out things like that as well.

    My initial test of adding a few blocks to a popup didn’t result in this issue, so I’m leaning towards some type of possible conflict that is causing them to be added.

    https://docs.wppopupmaker.com/article/332-test-whether-a-plugin-or-theme-interferes-with-popup-maker

    Hope that helps. If your issue is resolved please take a moment to rate and review the plugin or support.

    If you still need help please message us directly at https://wppopupmaker.com/support/.

    Thread Starter Webprom Design

    (@webprom)

    Hmm, it happens in Firefox. with Grammarly addon installed. But I don’t have such a problem with any other editor fields. Will check more later.

    Thread Starter Webprom Design

    (@webprom)

    HI!

    it happens again in Gutenberg editor for popup, on another site.

    <p><!-- /wp:paragraph --></p>
    <p><!-- wp:shortcode --><br>
    </p>

    I’m on firefox. Any ideas?

    I had the same problem and was able to resolve hooking into pum_popup_content and filtering out empty lines, comments, and empty p tags. Drop this into your functions.php or plugin:

    
    /**
     * Fix for Popup Maker Gutenberg compatibility
     * Need to strip out comments, blank lines and empty paragraph tags
     */
    add_filter( 'pum_popup_content', 'veer_popup_maker_gutenburg_compat' );
    
    function veer_popup_maker_gutenburg_compat($content) {
    	$content = preg_replace('!/\*.*?\*/!s', '', $content); // empty lines
    	$content = preg_replace('/<!--(.|\s)*?-->/', '', $content); // block editor comments
    	$content = preg_replace('/<p[^>]*><\\/p[^>]*>/', '', $content); // empty p tags
    	return $content;
    } 
    

    Note that pum_popup_content only runs when a popup is saved/updated. So to see the change, you’ll need to click update since the popups are cached.

    Hopefully this saves someone out there some time!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gutenberg blocks editor enabled, empty paragraphs in code adding more paddings’ is closed to new replies.