Source File
html.go
Belonging Package
github.com/google/safehtml
package safehtml
import (
)
func ( string) HTML {
return HTML{escapeAndCoerceToInterchangeValid()}
}
func ( string) string {
return html.EscapeString(coerceToUTF8InterchangeValid())
}
for , := range {
if unicode.Is(controlAndNonCharacter, ) {
= append(, unicode.ReplacementChar)
} else {
= append(, )
}
}
return string()
}
var controlChar = &unicode.RangeTable{
R16: []unicode.Range16{
{0x0000, 0x0008, 1},
{0x000B, 0x000B, 1},
{0x000E, 0x001F, 1},
{0x007F, 0x009F, 1},
},
LatinOffset: 4,
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |