goiblas / Map-Block-Leaflet

Map Block Leaflet for WordPress 🗺️
https://wordpress.org/plugins/map-block-leaflet
GNU General Public License v2.0
17 stars 10 forks source link

Javascript code gets wrapped in <p> #28

Closed oelna closed 4 years ago

oelna commented 4 years ago

For some reason Wordpress auto-wraps parts of the Javascript code in <p> Tags. Any tips what I can try to clear this up? I have a current version of WP and your plugin. The content gets no special treatment and is just output with the_content().

Screenshot 2020-06-05 at 17 19 30

This of course causes an error and the map never shows on the page.

Update:

I do in fact process the blocks, by passing them through render_block() inside add_filter('the_content', …). I disabled that and the map shows up fine. I don't know why that would be different than what Wordpress does during render anyway, but it fixed the issue. Luckily, I was in a position where removing the filter was possible.