wp-graphql-content-blocks
wp-graphql-content-blocks copied to clipboard
Feature: Add support for Xpath selectors
Description
Due to this https://github.com/wpengine/wp-graphql-content-blocks/issues/185 some selectors are wrong and do not capture accurately the html contents of an attribute. In that case we can replace those selectors with Xpath.
Acceptance criteria
- XPath selectors are supported
- Documentation entry added in Faust.org
Technical details
- Do a simple check if the selector starts with either
(//
or//
to determine if its an Xpath selector.
Cross responding here from https://github.com/wpengine/wp-graphql-content-blocks/issues/185#issuecomment-1929469992:
I havn't been following this issue too closely, but please keep in mind the general changes to the Block API as you're making these decisions.
Between the Interactivity API and Block Bindings API coming up, my gut tells me that we want to be using the HTML parser (assuming there isn't something block-specific to handle Lightbox Images, and to stay away from using Xpath directly.