htmlg

package
v0.0.0-...-abfb1be Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: Unlicense Imports: 4 Imported by: 2

Documentation

Overview

Package htmlg contains helper funcs for generating HTML nodes and rendering them. Context-aware escaping is done just like in html/template, making it safe against code injection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A

func A(s string, href template.URL) *html.Node

A returns an anchor element <a href="{{.href}}">{{.s}}</a>.

func Render

func Render(nodes ...*html.Node) template.HTML

Render renders HTML nodes. Context-aware escaping is done just like in html/template when rendering nodes.

func Strong

func Strong(s string) *html.Node

Strong returns a strong text node.

func Text

func Text(s string) *html.Node

Text returns a plain text node.

Types

This section is empty.

Jump to

Keyboard shortcuts

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