Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidName ¶
NameIsValid returns true or false if the s match allowed HTML Name pattern. https://stackoverflow.com/questions/925994/what-characters-are-allowed-in-an-html-attribute-name. usefull to check attribute or token name.
returns FALSE if s is empty
must be trimed before, if required
func IsValidNameRune ¶
func IsValidStyleRune ¶
func MakeValidName ¶
MakeValidName convert any invalid char in name into "_"
Example ¶
fmt.Println(MakeValidName("john"))
fmt.Println(MakeValidName("john Doe"))
fmt.Println(MakeValidName("john>Doe_À"))
fmt.Println(MakeValidName("1john"))
Output: john john_Doe john_Doe_À _john
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.