OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package html | 5 package html |
6 | 6 |
7 import ( | 7 import ( |
8 "bufio" | 8 "bufio" |
9 "errors" | 9 "errors" |
10 "fmt" | 10 "fmt" |
11 "io" | 11 "io" |
12 "strings" | 12 "strings" |
13 ) | 13 ) |
14 | 14 |
15 type writer interface { | 15 type writer interface { |
16 io.Writer | 16 io.Writer |
17 » io.ByteWriter | 17 » WriteByte(c byte) error // in Go 1.1, use io.ByteWriter |
18 WriteString(string) (int, error) | 18 WriteString(string) (int, error) |
19 } | 19 } |
20 | 20 |
21 // Render renders the parse tree n to the given writer. | 21 // Render renders the parse tree n to the given writer. |
22 // | 22 // |
23 // Rendering is done on a 'best effort' basis: calling Parse on the output of | 23 // Rendering is done on a 'best effort' basis: calling Parse on the output of |
24 // Render will always result in something similar to the original tree, but it | 24 // Render will always result in something similar to the original tree, but it |
25 // is not necessarily an exact clone unless the original tree was 'well-formed'. | 25 // is not necessarily an exact clone unless the original tree was 'well-formed'. |
26 // 'Well-formed' is not easily specified; the HTML5 specification is | 26 // 'Well-formed' is not easily specified; the HTML5 specification is |
27 // complicated. | 27 // complicated. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 "img": true, | 262 "img": true, |
263 "input": true, | 263 "input": true, |
264 "keygen": true, | 264 "keygen": true, |
265 "link": true, | 265 "link": true, |
266 "meta": true, | 266 "meta": true, |
267 "param": true, | 267 "param": true, |
268 "source": true, | 268 "source": true, |
269 "track": true, | 269 "track": true, |
270 "wbr": true, | 270 "wbr": true, |
271 } | 271 } |
OLD | NEW |