Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
413 stars 56 forks source link

Great than character in theme template causing issues #160

Closed Alex-Hay closed 1 year ago

Alex-Hay commented 1 year ago

Hi there,

A bit of an unusual one; i'm finding that using the greater than characters in quotes is removing the closing double quote (") and replacing it with a double prime character (″) – causing issues in the HTML.

.blade.php <div class="[&>*]:mb-0"></div> or <div class=">"></div> becomes .html <div class="[&>*]:mb-0″></div> or <div class=">″></div>

The below just causes an error. .blade.php <div class='[&>*]:mb-0'></div> or <div class='>'></div>

This isn't the case for other template files outside of the ACF Composer template files. It only applies to views>blocks>**.blade.php

Thanks for your hard work on acf-composer!

Log1x commented 1 year ago

Interesting.

Does it happen if you set jsx to false?

The only thing I can think of is it being some sort of bug with how ACF parses InnerContent/jsx inside of the template.

Alex-Hay commented 1 year ago

Hi @Log1x, thanks for your quick response.

I tried it without jsx and the same bug occurred. I also setup a new install, adding a simple ACF block to the twentytwentythree theme and ran into the same bug – so it must be on ACF's end.

I'll submit an issue on the ACF repo, thanks for your help!

orlockz commented 1 year ago

I ran into the exact same problem a few days ago. I tried using ">" (larger than) in an inline javascript function. (Using alpinejs) I couldn't understand why the closing " turned into ” on the element.

Thanks you guys. I thought I was the problem.. 😄

Log1x commented 1 year ago

https://github.com/AdvancedCustomFields/acf/issues/822 here's Alex's issue 💪 . I'm curious about their response. I think I've accidentally ran into this before as well.

SergiArias commented 1 year ago

It's a coincidence that we posted almost at the same time haha...

A workaround is to use the html entity: &gt; instead of >

Alex-Hay commented 1 year ago

I've just heard back from ACF on this. This seems to be an issue with wptexturize, and has popped up in a few issues:

WordPress/gutenberg/issues/15636 WordPress/gutenberg/pull/9963

It sounds like the ACF team are looking into a solution on there end (🤞), but it may only be resolvable in WP core.