internal/testing/htmlcheck: replace cascadia for htmlcheck.NotIn

This change reimplements a subset of cascadia's query functionality so
we can replace it for htmlcheck.NotIn. It adds code that parses a
subset of the css selector syntax (currently it's more than we need
for NotIn but not enough for In) and adds a query function to query
the selector in the given html node. Unlike cascadia, our query
function can match the node itself.

Future cls will add support for more selector syntax so we can support
everything htmlcheck.In is used for but we only intend so support just
what we need. I also limit the selector syntax to ascii for

For #61399

Change-Id: Ia03cc8a9ab42ae11d445a650e1ca0a07ee8a391f
LUCI-TryBot-Result: Go LUCI <>
kokoro-CI: kokoro <>
Reviewed-by: Jonathan Amsterdam <>
3 files changed
tree: dde9005cf2cbc2b7e21b17fc8652ba17cdab375f
  1. .github/
  2. cmd/
  3. deploy/
  4. devtools/
  5. doc/
  6. internal/
  7. migrations/
  8. static/
  9. tests/
  10. third_party/
  11. .dockerignore
  12. .eslintignore
  13. .eslintrc.yaml
  14. .gitignore
  15. .prettierignore
  16. .prettierrc.yaml
  17. .stylelintignore
  18. .stylelintrc.yaml
  19. all.bash
  21. go.mod
  22. go.sum
  23. jest.config.js
  25. package-lock.json
  26. package.json
  29. tsconfig.json

This repository hosts the source code of the website, and pkgsite, a documentation server program.

Go Reference a site for discovering Go packages is a website for discovering and evaluating Go packages and modules.

You can check it out at

pkgsite: a documentation server

pkgsite program extracts and generates documentation for Go projects.

Example usage:

$ go install
$ cd myproject
$ pkgsite -open .

For more information, see the pkgsite documentation.


Pkgsite requires Go 1.19 to run. The last commit that works with Go 1.18 is 9ffe8b928e4fbd3ff7dcf984254629a47f8b6e63. The last commit that works with Go 1.17 is 4d836c6a652cde92f433967680dfd6171a91ec12.


If you want to report a bug or have a feature suggestion, please first check the known issues to see if your issue is already being discussed. If an issue does not already exist, feel free to file an issue.

For answers to frequently asked questions, see

You can also chat with us on the #pkgsite Slack channel on the Gophers Slack.


We would love your help!

Our canonical Git repository is located at There is a mirror of the repository at

To contribute, please read our contributing guide.


Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.