package seaglass_test import ( "fmt" "git.golem15.com/golem15/summercms/modules/seaglass" ) func ExampleSanitizeReport() { clean, report := seaglass.SanitizeReport(`

Hi

`) fmt.Println(clean) fmt.Println(report.Elements, report.Attributes, report.Changed) // Output: //

Hi

// [script] [onclick] true } func ExampleCheck() { for _, stored := range []string{ `

Hi call

`, `

x

`, } { if err := seaglass.Check(stored); err != nil { // stored HTML would change under the policy fmt.Println(err) continue } fmt.Println("kept whole") } // Output: // kept whole // seaglass: HTML contains elements, attributes or URLs that are not allowed }