Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: pkg/dartdoc/lib/src/markdown/html_renderer.dart

Issue 11339056: Cleanup run on DartDoc from Dart Editor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 part of markdown;
6
5 String renderToHtml(List<Node> nodes) => new HtmlRenderer().render(nodes); 7 String renderToHtml(List<Node> nodes) => new HtmlRenderer().render(nodes);
6 8
7 /// Translates a parsed AST to HTML. 9 /// Translates a parsed AST to HTML.
8 class HtmlRenderer implements NodeVisitor { 10 class HtmlRenderer implements NodeVisitor {
9 static const _BLOCK_TAGS = const RegExp( 11 static const _BLOCK_TAGS = const RegExp(
10 'blockquote|h1|h2|h3|h4|h5|h6|hr|p|pre'); 12 'blockquote|h1|h2|h3|h4|h5|h6|hr|p|pre');
11 13
12 StringBuffer buffer; 14 StringBuffer buffer;
13 15
14 HtmlRenderer(); 16 HtmlRenderer();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } else { 52 } else {
51 buffer.add('>'); 53 buffer.add('>');
52 return true; 54 return true;
53 } 55 }
54 } 56 }
55 57
56 void visitElementAfter(Element element) { 58 void visitElementAfter(Element element) {
57 buffer.add('</${element.tag}>'); 59 buffer.add('</${element.tag}>');
58 } 60 }
59 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698