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 "os" | 9 "os" |
10 "strings" | 10 "strings" |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 p.popUntil(buttonScopeStopTags, "p") | 546 p.popUntil(buttonScopeStopTags, "p") |
547 p.addElement(p.tok.Data, p.tok.Attr) | 547 p.addElement(p.tok.Data, p.tok.Attr) |
548 case "h1", "h2", "h3", "h4", "h5", "h6": | 548 case "h1", "h2", "h3", "h4", "h5", "h6": |
549 p.popUntil(buttonScopeStopTags, "p") | 549 p.popUntil(buttonScopeStopTags, "p") |
550 switch n := p.top(); n.Data { | 550 switch n := p.top(); n.Data { |
551 case "h1", "h2", "h3", "h4", "h5", "h6": | 551 case "h1", "h2", "h3", "h4", "h5", "h6": |
552 p.oe.pop() | 552 p.oe.pop() |
553 } | 553 } |
554 p.addElement(p.tok.Data, p.tok.Attr) | 554 p.addElement(p.tok.Data, p.tok.Attr) |
555 case "a": | 555 case "a": |
556 » » » if n := p.afe.forTag("a"); n != nil { | 556 » » » for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scop
eMarkerNode; i-- { |
557 » » » » p.inBodyEndTagFormatting("a") | 557 » » » » if n := p.afe[i]; n.Type == ElementNode && n.Dat
a == "a" { |
558 » » » » p.oe.remove(n) | 558 » » » » » p.inBodyEndTagFormatting("a") |
559 » » » » p.afe.remove(n) | 559 » » » » » p.oe.remove(n) |
| 560 » » » » » p.afe.remove(n) |
| 561 » » » » » break |
| 562 » » » » } |
560 } | 563 } |
561 p.reconstructActiveFormattingElements() | 564 p.reconstructActiveFormattingElements() |
562 p.addFormattingElement(p.tok.Data, p.tok.Attr) | 565 p.addFormattingElement(p.tok.Data, p.tok.Attr) |
563 case "b", "big", "code", "em", "font", "i", "s", "small", "strik
e", "strong", "tt", "u": | 566 case "b", "big", "code", "em", "font", "i", "s", "small", "strik
e", "strong", "tt", "u": |
564 p.reconstructActiveFormattingElements() | 567 p.reconstructActiveFormattingElements() |
565 p.addFormattingElement(p.tok.Data, p.tok.Attr) | 568 p.addFormattingElement(p.tok.Data, p.tok.Attr) |
566 case "applet", "marquee", "object": | 569 case "applet", "marquee", "object": |
567 p.reconstructActiveFormattingElements() | 570 p.reconstructActiveFormattingElements() |
568 p.addElement(p.tok.Data, p.tok.Attr) | 571 p.addElement(p.tok.Data, p.tok.Attr) |
569 p.afe = append(p.afe, &scopeMarker) | 572 p.afe = append(p.afe, &scopeMarker) |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 im, consumed = im(p) | 1159 im, consumed = im(p) |
1157 } | 1160 } |
1158 // Loop until the final token (the ErrorToken signifying EOF) is consume
d. | 1161 // Loop until the final token (the ErrorToken signifying EOF) is consume
d. |
1159 for { | 1162 for { |
1160 if im, consumed = im(p); consumed { | 1163 if im, consumed = im(p); consumed { |
1161 break | 1164 break |
1162 } | 1165 } |
1163 } | 1166 } |
1164 return p.doc, nil | 1167 return p.doc, nil |
1165 } | 1168 } |
LEFT | RIGHT |