| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 String renderToHtml(List<Node> nodes) => new HtmlRenderer().render(nodes); | 5 String renderToHtml(List<Node> nodes) => new HtmlRenderer().render(nodes); |
| 6 | 6 |
| 7 /// Translates a parsed AST to HTML. | 7 /// Translates a parsed AST to HTML. |
| 8 class HtmlRenderer implements NodeVisitor { | 8 class HtmlRenderer implements NodeVisitor { |
| 9 static const _BLOCK_TAGS = const RegExp( | 9 static const _BLOCK_TAGS = const RegExp( |
| 10 'blockquote|h1|h2|h3|h4|h5|h6|hr|p|pre'); | 10 'blockquote|h1|h2|h3|h4|h5|h6|hr|p|pre'); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } else { | 50 } else { |
| 51 buffer.add('>'); | 51 buffer.add('>'); |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 void visitElementAfter(Element element) { | 56 void visitElementAfter(Element element) { |
| 57 buffer.add('</${element.tag}>'); | 57 buffer.add('</${element.tag}>'); |
| 58 } | 58 } |
| 59 } | 59 } |
| OLD | NEW |