• Resolved wepimedia

    (@wepimedia)


    I have tested this module on a site that is built with wpbakery.

    It all worked well with one weird exception. I am using another module for smooth scrolling. That did not work due to a js error in the generated version of the site.

    I found that the generated source code contains this:

    <script type="text/html" id="wpb-modifications"><script type="text/javascript" id="page-scroll-to-id-plugin-script-js-extra">

    There are 2 opening <script> tags which, of course, make no sense. The live site looks like this:

    <script type="text/html" id="wpb-modifications"></script>...

    Once I manually added this closing tag in the generated version everything was fine, no more errors.

    I don’t know what this tag is good for. Wpbakery generates this tag like this:

    class Vc_Modifications {
    	public static $modified = false;
    
    	public function __construct() {
    		add_action( 'wp_footer', array(
    			$this,
    			'renderScript',
    		) );
    	}
    
    	public function renderScript() {
    		if ( self::$modified ) {
    			// output script
    			$tag = 'script';
    			echo '<' . $tag . ' type="text/html" id="wpb-modifications"></' . $tag . '>';
    		}
    	}
    }

    Maybe this is a bit of a non-conformistic approach so that your module does not catch this?

    But also maybe an easy fix for you so I thought I let you know.

Viewing 1 replies (of 1 total)
  • Plugin Author patrickposner

    (@patrickposner)

    Hey @wepimedia,

    thanks for your report!

    That is indeed something we can’t handle right now as our parser works based on W3C validation, and <script type=”text/html”></script> is an invalid HTML markup.

    We then try to “auto-fix” the markup, but in some cases, that produces an even worse result (just like in your case).

    We take a look to see if we can somehow support this, but a better (long-term) strategy would be a filter within WPBakery to replace the tag.

    Any other tag would work perfectly fine on an export:

    <span id="wpb-modifications"></span>

    Cheers,
    Patrick

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with wpbakery’ is closed to new replies.