|
@@ -1067,6 +1067,11 @@ loop:
|
|
|
|
|
|
|
|
// Raw returns the unmodified text of the current token. Calling Next, Token,
|
|
// Raw returns the unmodified text of the current token. Calling Next, Token,
|
|
|
// Text, TagName or TagAttr may change the contents of the returned slice.
|
|
// Text, TagName or TagAttr may change the contents of the returned slice.
|
|
|
|
|
+//
|
|
|
|
|
+// The token stream's raw bytes partition the byte stream (up until an
|
|
|
|
|
+// ErrorToken). There are no overlaps or gaps between two consecutive token's
|
|
|
|
|
+// raw bytes. One implication is that the byte offset of the current token is
|
|
|
|
|
+// the sum of the lengths of all previous tokens' raw bytes.
|
|
|
func (z *Tokenizer) Raw() []byte {
|
|
func (z *Tokenizer) Raw() []byte {
|
|
|
return z.buf[z.raw.start:z.raw.end]
|
|
return z.buf[z.raw.start:z.raw.end]
|
|
|
}
|
|
}
|