html

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCXfs added in v0.10.0

func DefaultCXfs() goxic.ContentXformers

func EscWrap

func EscWrap(cnt goxic.Content) goxic.Content

func FormatPh added in v0.11.0

func FormatPh(name string, mode goxic.PhWriteMode) string

func NewParser

func NewParser(cxfs goxic.ContentXformers) *goxic.Parser

Types

type Escaper

type Escaper struct {
	Cnt goxic.Content
}

func (Escaper) WriteTo added in v0.9.0

func (hc Escaper) WriteTo(wr io.Writer) (int64, error)

type Span

type Span struct {
	Wrapped goxic.Content
	// contains filtered or unexported fields
}

Span wraps content into a HTML <span></span> element

Example
out := os.Stdout
cnt := cnt.P("foo")
span := NewSpan(cnt, "", "")
span.WriteTo(out)
fmt.Fprintln(out)
span = NewSpan(cnt, "&ID", "")
span.WriteTo(out)
fmt.Fprintln(out)
span = NewSpan(cnt, "", "'CLS")
span.WriteTo(out)
fmt.Fprintln(out)
span = NewSpan(cnt, "&ID", "'CLS")
span.WriteTo(out)
fmt.Fprintln(out)
Output:

<span>foo</span>
<span id="&amp;ID">foo</span>
<span class="&#39;CLS">foo</span>
<span id="&amp;ID" class="&#39;CLS">foo</span>

func NewSpan

func NewSpan(around goxic.Content, spanId string, spanClass string) *Span

func (*Span) WriteTo added in v0.9.0

func (s *Span) WriteTo(wr io.Writer) (res int64, err error)

Jump to

Keyboard shortcuts

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