mgdm / htmlq

Like jq, but for HTML.
MIT License
7k stars 107 forks source link

Class selector missing result when child of `<template></template>` #57

Open tomarrell opened 1 year ago

tomarrell commented 1 year ago

When attempting to select an element as a child of a <template> tag, htmlq does not return the result.

The following snippet is a minimal reproducible example, and taken from the GitHub home page.

<template>
   <details-dialog>
      <div class="octocat-spinner"></div>
   </details-dialog>
</template>

When attempting to select the .octocat-spinner element, no results are returned. This is also the case when changing the selector and element to use an ID.

$ cat github.com | htmlq '.octocat-spinner'

However, when you remove the surrounding template tags, the element is found.