ghtml

package
v2.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 4 Imported by: 12

Documentation

Overview

Package ghtml provides useful API for HTML content handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Entities

func Entities(s string) string

Entities encodes all HTML chars for content. Referer: http://php.net/manual/zh/function.htmlentities.php

func EntitiesDecode

func EntitiesDecode(s string) string

EntitiesDecode decodes all HTML chars for content. Referer: http://php.net/manual/zh/function.html-entity-decode.php

func SpecialChars

func SpecialChars(s string) string

SpecialChars encodes some special chars for content, these special chars are: "&", "<", ">", `"`, "'". Referer: http://php.net/manual/zh/function.htmlspecialchars.php

func SpecialCharsDecode

func SpecialCharsDecode(s string) string

SpecialCharsDecode decodes some special chars for content, these special chars are: "&", "<", ">", `"`, "'". Referer: http://php.net/manual/zh/function.htmlspecialchars-decode.php

func SpecialCharsMapOrStruct

func SpecialCharsMapOrStruct(mapOrStruct interface{}) error

SpecialCharsMapOrStruct automatically encodes string values/attributes for map/struct.

func StripTags

func StripTags(s string) string

StripTags strips HTML tags from content, and returns only text. Referer: http://php.net/manual/zh/function.strip-tags.php

Types

This section is empty.

Jump to

Keyboard shortcuts

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