sami

package
v0.0.0-...-0c9f346 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(r io.Reader) (*html.Node, error)

Parse returns the root of parsed SAMI tree that was read from the io.Reader.

It doesn't implement the SAMI spec and its basically a super simple tag parser, watered down from golang.org/x/net/html, using its tokenizer. The main reason we had to create this is just so we can have an html-like parser that doesn't enforce HTML5 spec restrictions and semantics(e.g. requiring the document to have an html root with head/body, html5 semantics, etc). Since most golang pkgs for parsing/querying/editing html do parsing using golang.org/x/net/html, they all end up messing with the resulting SAMI tree, which can lead to weird/unexpected results, so this fixes that.

The input is assumed to be UTF-8 encoded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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