html类

package
v0.0.0-...-2910145 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ghtml 提供了用于处理 HTML 内容的有用 API。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func X删除HTML标记

func X删除HTML标记(html文本 string) string

StripTags 从内容中剥离 HTML 标签,仅返回文本内容。 参考来源:http://php.net/manual/zh/function.strip-tags.php

func X编码

func X编码(html文本 string) string

Entities 将内容中的所有HTML字符进行编码。 参考来源: http://php.net/manual/zh/function.htmlentities.php

func X编码Map

func X编码Map(map或Struct interface{}) error

SpecialCharsMapOrStruct 自动对 map 或 struct 中的字符串值/属性进行编码。

func X编码特殊字符

func X编码特殊字符(文本 string) string

SpecialChars 为内容编码一些特殊字符,这些特殊字符包括: "&", "<", ">", `"`, "'". 参考:http://php.net/manual/zh/function.htmlspecialchars.php

func X解码

func X解码(文本 string) string

EntitiesDecode 将内容中的所有HTML字符进行解码。 参考:http://php.net/manual/zh/function.html-entity-decode.php

func X解码特殊字符

func X解码特殊字符(文本 string) string

SpecialCharsDecode 对内容中的某些特殊字符进行解码,这些特殊字符包括: "&"(和号)、"<"(小于号)、">"(大于号)、`"`(双引号)、"'"(单引号)。 参考文档:http://php.net/manual/zh/function.htmlspecialchars-decode.php

Types

This section is empty.

Jump to

Keyboard shortcuts

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