OLD | NEW |
1 /// This library has a parser for HTML5 documents, that lets you parse HTML | 1 /// This library has a parser for HTML5 documents, that lets you parse HTML |
2 /// easily from a script or server side application: | 2 /// easily from a script or server side application: |
3 /// | 3 /// |
4 /// import 'package:html/parser.dart' show parse; | 4 /// import 'package:html/parser.dart' show parse; |
5 /// import 'package:html/dom.dart'; | 5 /// import 'package:html/dom.dart'; |
6 /// main() { | 6 /// main() { |
7 /// var document = parse( | 7 /// var document = parse( |
8 /// '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!'); | 8 /// '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!'); |
9 /// print(document.outerHtml); | 9 /// print(document.outerHtml); |
10 /// } | 10 /// } |
(...skipping 3802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3813 return span.sourceUrl == null ? 'ParserError on $res' : 'On $res'; | 3813 return span.sourceUrl == null ? 'ParserError on $res' : 'On $res'; |
3814 } | 3814 } |
3815 } | 3815 } |
3816 | 3816 |
3817 /// Convenience function to get the pair of namespace and localName. | 3817 /// Convenience function to get the pair of namespace and localName. |
3818 Pair<String, String> getElementNameTuple(Element e) { | 3818 Pair<String, String> getElementNameTuple(Element e) { |
3819 var ns = e.namespaceUri; | 3819 var ns = e.namespaceUri; |
3820 if (ns == null) ns = Namespaces.html; | 3820 if (ns == null) ns = Namespaces.html; |
3821 return new Pair(ns, e.localName); | 3821 return new Pair(ns, e.localName); |
3822 } | 3822 } |
OLD | NEW |