Block editor changing HTML entities within Shortcode block shortcode attribute values after reload #49664
Labels
[Block] Shortcode
Affects the Shortcode Block
[Feature] Block Validation/Deprecation
Handling block validation to determine accuracy and deprecation
[Type] Bug
An existing feature does not function as intended
[Type] Enhancement
A suggestion for improvement.
Description
HTML entities within shortcode attributes are modified by the block editor after reloading.
If the user does not make changes to the content, I believe the block editor should not modify that content. Furthermore, the content is correctly saved if the user manually replaces the encoded entities back to their original form.
This behavior seems to demonstrate that literal entities are acceptable in storage from the block editor and retrieval outside of the block editor. There seems to be a disconnect in entity encoding when content is loaded back into the block editor and then saved again.
Furthermore, HTML entities like
<>
within shortcode attributes cause theThis block contains unexpected or invalid content. [ Attempt Block Recovery ]
notice on the shortcode block.Step-by-step reproduction instructions
&
error_log()
the shortcode attribute's value and notice it correctly contains&
&
in the shortcode attribute is now displayed as&
error_log()
the shortcode attribute's value and notice it now contains&
Example shortcode
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes (not using the Gutenberg plugin, simply WordPress 6.2 with no active plugins)
The text was updated successfully, but these errors were encountered: