Skip to content
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

Shortcode block: Change source of text attribute to html #13609

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

mcsf
Copy link
Contributor

@mcsf mcsf commented Jan 30, 2019

Description

The Shortcode block has one attribute, text, representing the contents of a WordPress shortcode. This pull requests changes the source of said attribute from text to html, thus extending the field to support raw HTML, as may be required by certain shortcodes.

Quoting @aduth in #13399 (comment):

[…] because it saves using RawHTML, there's no reason the shortcode block shouldn't also define its attribute as being sourced via 'html'. I expect the original implementation didn't expect HTML to be embedded within a shortcode, so it defaulted to text.

Fixes #13399.

/cc @chunkyRice

How has this been tested?

  • Stress-test the Shortcode block by giving it shortcodes that may include HTML entities or HTML markup. To ensure the data is properly serialised, saved, loaded and validated, inspect saved posts with wp-cli and reload the editor while monitoring the browser console.
  • Try reproducing the circumstances described in Unescaped HTML inside shortcode attributes breaks block validation #13399 with that HTML-rich shortcode.
  • Test the conversion from Classic to Shortcode.

Types of changes

Enhancement.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@aduth aduth merged commit 9679df4 into master Feb 14, 2019
@aduth aduth deleted the fix/shortcode-block-source-from-html branch February 14, 2019 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Feature] Shortcodes Related to shortcode functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants