Documentation
¶
Overview ¶
Package textdiff compares what different agents were shown on a page.
Comparisons work on visible text, not raw HTML, so that nonces, CSRF tokens, inline scripts and attribute order do not count as differences.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Similarity ¶
Similarity returns a score in [0, 1] for how alike two visible texts are, using the Jaccard index over word 3-grams (shingles). Identical texts score 1; texts with nothing in common score 0.
func VisibleText ¶
VisibleText extracts the human-visible text of an HTML document, one block per line, with whitespace collapsed. The <title> is kept even though it lives in <head>.
Types ¶
Click to show internal directories.
Click to hide internal directories.