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

Add shortcode package #7581

Merged
merged 2 commits into from
Jun 27, 2018
Merged

Add shortcode package #7581

merged 2 commits into from
Jun 27, 2018

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Jun 27, 2018

Description

This branch adds a shortcode package to Gutenberg, instead of relying on the core global. This is needed for us to add tests for the shortcode converter (and future tweaks).

See https://github.com/WordPress/wordpress-develop/blob/master/src/js/_enqueues/wp/shortcode.js and https://github.com/WordPress/wordpress-develop/blob/master/tests/qunit/wp-includes/js/shortcode.js.

How has this been tested?

Ensure shortcode converting still works.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@ellatrix ellatrix added [Feature] Paste npm Packages Related to npm packages labels Jun 27, 2018
@ellatrix ellatrix added this to the 3.2 milestone Jun 27, 2018
@ellatrix ellatrix requested a review from a team June 27, 2018 17:54
@ellatrix
Copy link
Member Author

Still making some doc block tweaks.

@ellatrix
Copy link
Member Author

I think this is ready for review. I don't know if we want to make any other tweaks to the shortcode code...

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Good stuff 👍

<!-- wp:gallery {"columns":3,"linkTo":"attachment"} -->
<ul class="wp-block-gallery alignnone columns-3 is-cropped">
<li class="blocks-gallery-item">
<figure><img data-id="1" /></figure>
Copy link
Member

Choose a reason for hiding this comment

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

A bit unfortunate that without the editor session to request and populate these attributes, we're effectively mangling the original content and destroying the images which would otherwise be shown by running it through the parser. Not really sure we have an option here outside of allowing transforms to be asynchronous.

@gziolo
Copy link
Member

gziolo commented Jun 27, 2018

Cool 🎉

@ellatrix ellatrix merged commit 2fca405 into master Jun 27, 2018
@ellatrix ellatrix deleted the add/shortcode-package branch June 27, 2018 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste npm Packages Related to npm packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants