Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
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.