sanitize

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package sanitize provide a function to sanitize markup document into plain text.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTML

func HTML(in []byte) (plain []byte)

HTML sanitize the content of HTML into plain text.

Example
input := `
<html>
	<title>Test</title>
	<head>
	</head>
	<body>
		This
		<p> is </p>
		a
		<a href="/">link</a>.
		An another
		<a href="/">link</a>.
	</body>
</html>
`

out := HTML([]byte(input))
fmt.Printf("%s", out)
Output:

This is a link. An another link.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL