Thread Starter
hpr78
(@hpr78)
Found the problem in prismatic/inc/prismatic-core.php
it wp_kses_post all the content, not only the prismatic specific content.
function prismatic_decode($text) {
// ...
$output .= $content;
}
return wp_kses_post($output);
}
It should be better to secure only the replaced content:
function prismatic_decode($text) {
// ...
$output .= wp_kses_post( $content );
}
return $output;
}
`
Thread Starter
hpr78
(@hpr78)
Or complete without wp_kses_post, cause before you esc_html the content.
Thanks for the infos and help, @hpr78. Will be looking into this (and the other recent escape-related issues soon.
@hpr78 What are the steps to repeat this issue? I am trying but failing to get the reported behavior. I have all the same settings that you’ve outlined. I have block editor enabled. But from there not sure which block(s) are involved, and in which order. If you can walk me through the steps to replicate the issue, I will be able to investigate asap. Thank you.
Update: after much investigation, I narrowed down the issue to one thing: the block editor force escapes left-angle brackets and other characters. I’ve tried many different things, ways of adding block elements and so forth, but so far nothing works.
So, the plan is to ask for help from the WP community. I posted a forum topic here explaining the issue and asking for help. I’m not sure if it’s even possible to achieve. If it is, then Prismatic will continue to provide its own Gutenberg block. If not, then the block will be discontinued.
If you or anyone has insight on how to add code snippets *raw* unescaped into a block, please let me know. Check the above-linked support topic for more details. Thank you.
Thread Starter
hpr78
(@hpr78)
Thanks but the plugin doesn’t use any build step, how would you write that in vanilla JS?
Update: Finally figured it out, it was an issue with the render callback function.
So that means Prismatic will continue to provide the same blocks as before, only without the weird code-escaping bug.
Thanks for reporting, @hpr78.