• Michael Piatek's avatar
    go.net/html: Tokenizer.Raw returns the original input when tokenizer errors occur. · 480e7b06
    Michael Piatek authored
    Two tweaks enable this:
    1) Updating the raw and data span pointers when Tokenizer.Next is called, even
    if an error has occurred. This prevents duplicate data from being returned by
    Raw in the common case of an EOF.
    
    2) Treating '</>' as an empty comment token to expose the raw text as a
    tokenization event. (This matches the semantics of other non-token events,
    e.g., '</ >' is treated as '<!-- -->'.)
    
    Fixes golang/go#7029.
    
    R=golang-codereviews, r, bradfitz
    CC=golang-codereviews
    https://golang.org/cl/46370043
    480e7b06
Name
Last commit
Last update
..
atom Loading commit data...
charset Loading commit data...
testdata Loading commit data...
const.go Loading commit data...
doc.go Loading commit data...
doctype.go Loading commit data...
entity.go Loading commit data...
entity_test.go Loading commit data...
escape.go Loading commit data...
escape_test.go Loading commit data...
example_test.go Loading commit data...
foreign.go Loading commit data...
node.go Loading commit data...
node_test.go Loading commit data...
parse.go Loading commit data...
parse_test.go Loading commit data...
render.go Loading commit data...
render_test.go Loading commit data...
token.go Loading commit data...
token_test.go Loading commit data...