nk-crew / lazy-blocks

Use Lazy Blocks plugin to rapidly build custom blocks without ever leaving your WordPress editor
https://www.lazyblocks.com/
GNU General Public License v2.0
337 stars 41 forks source link

Charectars converted to Unicode Decimal Code In Alpine JS Javascript Components #261

Closed arceoh closed 5 months ago

arceoh commented 2 years ago

Issue description:

When using Alpine JS a few characters get converted to Unicode Decimal Code.

'>' gets converted to '>\‘

So when having this in a block.php

<div x-data="{ foo: '>'}">
    <p x-text="foo"></p>
</div>

You get this in the page source

<div x-data="{ foo: '>&#8216;}&#8221;>
    <p x-text="foo"></p>
</div>

Lazy Blocks Version:

2.5.3

WordPress Version:

6.0.1

Any helpful information to reproduce the issue (screenshots, code parts)

Same issue happens when using ACF Pro Blocks. Vanilla JS like <script>console.log('>')</script> works fine.

nk-o commented 5 months ago

Our plugin provides the correct HTML. However, an escaping function within the Gutenberg render callback is breaking the code. Not sure we can somehow fix it.