AO3: [Wrangling] Search Term Highlighting

highlights the search terms in the results

Auteur
escctrl
Nombre d'installations quotidiennes
0
Nombre d'installations
8
Évaluations
0 0 0
Version
6.1
Créer
2024-07-28
Mis à jour
2024-11-04
Licence
MIT
S'applique à

Adds a "Highlight Search Terms" button at the top of the search results, to highlight where in the results the search term(s) are contained.
When I was a newbie wrangler, this helped me better understand the search logic of AO3, and why I was seeing the results I was getting. It helps focus the eye when tags are chatty or when a lot of partial matches are being pulled in.

Works on the original Search page, as well as with my script that can turn the results into a table.

The STRICT_HIGHLIGHT configuration at the beginning of the script changes the behavior of the highlighting with special characters a little, when the search term didn't include asterisk:

  • false = like AO3 searches by ignoring special characters
  • true = as you probably meant it, by searching for the literal special character

Examples using a search term of "sugar & spice" in quotation marks, without asterisk. Ao3 search ignores the ampersand in the middle.

I cannot guarantee it will work 100% of the time since the script takes a somewhat simplified approach to reverse-engineering the search matching of AO3 ^_^ Please let me know of specific examples where it behaves weirdly and I'll happily look into it.