• The developer’s guide for Gutenberg says: “Under the hood, attribute sources are a superset of functionality provided by hpq, a small library used to parse and query HTML markup into an object shape.”

    Hpq is indeed a very small and very handy library, but I cannot figure out how to call its methods from my own plugin.

    For my own plugin I have just included a copy of hpq so far, but the ideal solution would of course be to use the one shipped with WordPress.

    Wordpress’ (slightly recoded) version of hpq appears to be included in wp-includes/js/dist/blocks.js from line 6836 onwards (“// CONCATENATED MODULE: ./node_modules/hpq/es/get-path.js”).

    The code of that file looks so convoluted that I can make heads nor tails of it.

    The reason I need hpq, rather than relying on the blocks API, is because I have a plugin that did blocks-like things years before blocks existed, and I want to harvest parts of the output of that plugin rather than having to code everything again.

    The page I need help with: [log in to see the link]

  • The topic ‘How to call HPQ functions?’ is closed to new replies.