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

HTML API: Add matches_breadcrumbs() to HTML Processor for better querying #5243

Closed

Commits on Sep 26, 2023

  1. HTML API: Add matches_breadcrumbs() to HTML Processor for better qu…

    …erying
    
    Inside a `next_tag()` loop it can be challenging to use breadcrumbs because
    they are only exposed inside the call to `next_tag()` via the `$query` arg.
    
    In this patch a new method, `matches_breadcrumbs()` is exposed which allows
    for querying within the `next_tag()` loop for more complicated queries.
    
    This method exposes a wildcard `*` operator to allow matching _any HTML tag_
    that the currently-matched tag is a child or descendant of.
    dmsnell authored and ockham committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    c190ee3 View commit details
    Browse the repository at this point in the history
  2. Replace next_tag() logic with new method

    dmsnell authored and ockham committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    942f3b1 View commit details
    Browse the repository at this point in the history
  3. PR feedback

     - add wildcard to docblock description of breadcrumbs parameters
     - revert to scanning breadcrumb array with end/current/prev to handle sparse arrays
    
    Props: @westonruter
    dmsnell authored and ockham committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    e20baa4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cd79cdd View commit details
    Browse the repository at this point in the history