goquery calls html.Parse, so callers cannot reach the parse options that
golang.org/x/net/html has since grown. The one that matters is
ParseOptionEnableScripting(false): with scripting assumed enabled the
contents of a noscript element are parsed as raw text and no selector
can reach inside it.
Add a constructor taking html.ParseOption values. Existing constructors
are untouched.
Refs #139
Move the "stop at first match" optimization out of HasMatcher and into
singleMatcher, where it can be reused elsewhere.
singleMatcher now implements MatchFirst, which calls the underlying
Matcher's MatchFirst if it provides one (cascadia-compiled matchers all
do), otherwise falls back to MatchAll and returns its first element.
singleMatcher.MatchAll wraps MatchFirst's result in a single-item slice
to respect the Matcher interface, so external SingleMatcher() users get
the slice signature while internal callers can avoid that allocation.
HasMatcher now constructs a singleMatcher directly to call MatchFirst
without a type assertion, removing the duplicated probe branch.