LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 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 "io" | 8 "io" |
9 "strings" | 9 "strings" |
10 ) | 10 ) |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 if p.hasSelfClosingToken { | 243 if p.hasSelfClosingToken { |
244 p.hasSelfClosingToken = false | 244 p.hasSelfClosingToken = false |
245 p.tok.Type = EndTagToken | 245 p.tok.Type = EndTagToken |
246 p.tok.Attr = nil | 246 p.tok.Attr = nil |
247 return nil | 247 return nil |
248 } | 248 } |
249 p.tokenizer.Next() | 249 p.tokenizer.Next() |
250 p.tok = p.tokenizer.Token() | 250 p.tok = p.tokenizer.Token() |
251 switch p.tok.Type { | 251 switch p.tok.Type { |
252 case ErrorToken: | 252 case ErrorToken: |
253 » » return p.tokenizer.Error() | 253 » » return p.tokenizer.Err() |
254 case SelfClosingTagToken: | 254 case SelfClosingTagToken: |
255 p.hasSelfClosingToken = true | 255 p.hasSelfClosingToken = true |
256 p.tok.Type = StartTagToken | 256 p.tok.Type = StartTagToken |
257 } | 257 } |
258 return nil | 258 return nil |
259 } | 259 } |
260 | 260 |
261 // Section 11.2.4. | 261 // Section 11.2.4. |
262 func (p *parser) acknowledgeSelfClosingTag() { | 262 func (p *parser) acknowledgeSelfClosingTag() { |
263 p.hasSelfClosingToken = false | 263 p.hasSelfClosingToken = false |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 im, consumed = im(p) | 1172 im, consumed = im(p) |
1173 } | 1173 } |
1174 // Loop until the final token (the ErrorToken signifying EOF) is consume
d. | 1174 // Loop until the final token (the ErrorToken signifying EOF) is consume
d. |
1175 for { | 1175 for { |
1176 if im, consumed = im(p); consumed { | 1176 if im, consumed = im(p); consumed { |
1177 break | 1177 break |
1178 } | 1178 } |
1179 } | 1179 } |
1180 return p.doc, nil | 1180 return p.doc, nil |
1181 } | 1181 } |
LEFT | RIGHT |