pym-shortcode icon indicating copy to clipboard operation
pym-shortcode copied to clipboard

Use Gutenberg's native `anchor` support for setting the pym parent element ID

Open benlk opened this issue 7 years ago • 2 comments

We didn't do this in the initial implementation of Gutenberg blocks in #34 because, at the time, it appeared as if there was no way to use Gutenberg's anchor property with a block that was dynamically rendered.

For more history, see the following comments:

  • https://github.com/INN/pym-shortcode/pull/34#issuecomment-417355256
  • https://github.com/WordPress/gutenberg/issues/6356#issuecomment-417176119
  • https://github.com/WordPress/gutenberg/pull/8154/files, the current version of which is https://wordpress.org/gutenberg/handbook/block-api/#supports-optional

Elements of this ticket:

  • [ ] remove the shim introduced in #34
  • [ ] add a supports declaration for anchor
  • [ ] add the anchor output to the pym_shortcode function.

benlk avatar Aug 30 '18 20:08 benlk

After https://github.com/INN/pym-shortcode/commit/2613c2557e797cd797b44da73f15a7f58d49832e, we have a save method that does store some things in the post_content directly, so it's worth rechecking to see if we can grab that.

benlk avatar Sep 05 '18 22:09 benlk

in progress on 35-anchor-redux, but still no idea how to get the anchor value passed to the shortcode, even when trying to pull it from the post_content.

benlk avatar Sep 20 '18 23:09 benlk