-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no_texturize_shortcodes WP filter broken with block themes #37754
Comments
I can reproduce the issue on TT2. Works well in TT1. Some context from the research and testing I did in the trac ticket (bringing it here).... Thanks for the update. Yes, I can reproduce in TT2 which is a block theme. What's known:
Some research:
I asked @casaschi to report it here as I couldn't find anything in Core or TT2 that is causing the issue. I'm wondering if something in the HTML sanitizing or |
It looks like At this point, the shortcode is already parsed by content block, and gutenberg/lib/compat/wordpress-5.9/block-template.php Lines 217 to 218 in c9425ae
If I remove the I think moving it before Cc @felixarntz. |
Thanks for debugging this issue. I tried on my test site with WP 5.9RC and I can confirm that moving wptexturize() before do_blocks() solves the issue. Good catch! Thanks again. |
@youknowriad @ockham: Is it harmless to move |
The filters I like the idea of a solution that applies
|
Any progress on this? WP 5.9.1 is out but this issue has not been addressed yet. |
WP 5.9.2 out but this issue has not been fixed yet :-( |
WP 5.9.3 did not fix this either. |
WP 6.0 still did not fix this. |
Can confirm...still waiting for a patch here. |
This bug has been reported for several months; since then, a couple of WP releases did not address it despite the root cause for the issue being quickly identified within the I could easily bypass the issue by manually reversing the unwanted changes affecting my plugin; I have been hesitant doing so because the issue should rather be addressed where it occurrs. Could anyone from the WP and/or Gutenberg developers teams please advise when this is going to be fixed? Thanks for the feedback. |
Since it's still not patched, I am currently forced to use this due to the nature of how the shortcode uses JSON code inside it's content. WP decided to start replacing straight quotes with smart quotes for some themes, and some others not, no clue. All tests where done with the dedicated shortcode block element provided by WP. The below just disables it globally, which works for me, nothing else worked. I tried to remove the filter specifically for the content itself, but it didn't work. I guess it won't harm anything, except that "smart" quotes are better from a readability point of view. No idea if disabling it globally has any other impacts.
|
@RensTillmann quite a shame ignoring this issue and leaving the no_texturize_shortcodes filter broken. I found a different workaround, it works for me but it might not be suitable for everyone: it seems wordpress does not texturize text within certain html tags, for example anything in a PRE tag is not texturized. It works for my plugin to enclose certain text in an otherwise unnecessary PRE tag and make sure no texturization happens. Hopefully this bug will be fixed soon |
This is a larger problem than the original specific issue (shortcode result being texturized with block themes, even though it's added in The root cause that should be addressed is that there's a whole stack of content filters, including It introduces subtle bugs, for example, the one that led me to this GitHub issue discussion (and similar to what @RensTillmann mentioned): some blocks or shortcodes render a JSON string, a piece of HTML, or any other kind of text that must not be modified, which can get corrupted unexpectedly by one of the filters. The way it currently works, there's no way for block authors to opt-out of these filters; the most they can do is to work around or reverse their effects. A better design would be to not process the resulting HTML of a block by default, except for certain blocks where
I understand that would be a backward-incompatible change, and unlikely to be implemented in an ideal way. In that case, perhaps there can be an "escape hatch" for block authors to wrap their HTML somehow, or an option in |
Still not fixed in 6.5.4 using the TwentyTwentyThree theme. I'm hitting a problem with ABC music data in a shortcode that makes use of a <textarea>. I'd love to see #44995 implemented is that is considered to be the best solution. |
Description
Instructed to open a bug report here from https://core.trac.wordpress.org/ticket/54614#comment:13
Hello, my wordpress plugin embed-chessboard uses the code below to avoid texturization of the text within a shortcode. In wordpess 5.9 with the Twenty Twenty-Two theme the filter does not seems to have effect with texturization applied to the text within the shortcode (particularly straight quotes " get changed into opening/closing quotes, breaking things apart).
More technical notes at the original WP bug report https://core.trac.wordpress.org/ticket/54614
Step-by-step reproduction instructions
Use 5.9 RC1.
Screenshots, screen recording, code snippet
with TT1 theme:
with TT2 theme:
Environment info
WordPress: 5.9 RC1 (though happened on Beta versions too)
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Plugin activated: Embed Chessboard.
Occurs with and without Gutenberg plugin.
The text was updated successfully, but these errors were encountered: