script tags getting modified during import
-
My Joomla pages have several script tags at the beginning of each page to embedded rumble such as:
<div class="hentry" data-sync="textbox_content"><span style="color: red; font-size: x-large;">Dog Rope Toy</span>
<p><script>!function(r,u,m,b,l,e){r._Rumble=b,r[b]||(r[b]=function(){(r[b]._=r[b]._||[]).push(arguments);if(r[b]._.length==1){l=u.createElement(m),e=u.getElementsByTagName(m)[0],l.async=1,l.src="https://rumble.com/embedJS/uwkr1e"+(arguments[1].video?'.'+arguments[1].video:'')+"/?url="+encodeURIComponent(location.href)+"&args="+encodeURIComponent(JSON.stringify([].slice.apply(arguments))),e.parentNode.insertBefore(l,e)}})}(window, document, "script", "Rumble");</script></p>
<div id="rumble_v3t6t3h"> </div>
<p><script><br />
Rumble("play", v3t6t3h);</script></p>
The imported post is getting modified to
<p><script>!function(r,u,m,b,l,e){r._Rumble=b,r[b]||(r[b]=function(){(r[b]._=r[b]._||[]).push(arguments);if(r[b]._.length==1){l=u.createElement(m),e=u.getElementsByTagName(m)[0],l.async=1,l.src="https://rumble.com/embedJS/uwkr1e"+(arguments[1].video?'.'+arguments[1].video:'')+"/?url="+encodeURIComponent(location.href)+"&args="+encodeURIComponent(JSON.stringify([].slice.apply(arguments))),e.parentNode.insertBefore(l,e)}})}(window, document, "script", "Rumble");</script></p>
<div id="rumble_v3t6t3h"> </div>
<p><script><br />
Rumble("play", v3t6t3h);</script></p>The adding of <p> </p> <br /> is odd and causing other issues, but the last Rumble line is breaking the playing since the div tag is gone and the video tag is corrupted.
I’ve tried some pre-filters(via code snippet) with no luck, I’m not sure if this it the import itself or WP/Theme (Pagelayer/PopularFX) is modifying on-the-fly the import as well creating the issue. This also causes pagelayer to break with a critical error when trying to edit theme/blog template.
Edit: Not the theme, I temporarily switched to twenty-twentyfive and same issue after import. Maybe a core WP function?
Any ideas?
Thanks you,
The topic ‘script tags getting modified during import’ is closed to new replies.