package sanitizer
import "golang.org/x/pkgsite/internal/sanitizer"
Package sanitizer provides a simple html sanitizer to remove tags and attributes that could potentially cause security issues.
Index ¶
Functions ¶
func SanitizeBytes ¶
SanitizeBytes returns a sanitized version of the input. It throws out any attributes or tags that are not explicitly allowed in allowElems or allowAttributes below, including any child nodes of elements that are not allowed. It returns the empty string if there was an error parsing the input.
Source Files ¶
sanitizer.go
- Version
- v0.0.0-20250523174444-0e6de173c6b5 (latest)
- Published
- May 23, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 month ago –
Tools for package owners.