Linter Demo Errors: 2Warnings: 6File: /home/fstrocco/Dart/dart/benchmark/markdown/lib/src/html_renderer.dart library markdown.html_renderer; import 'ast.dart'; import 'document.dart'; import 'inline_parser.dart'; String markdownToHtml(String markdown, {List inlineSyntaxes, Resolver linkResolver, Resolver imageLinkResolver, bool inlineOnly: false}) { var document = new Document(inlineSyntaxes: inlineSyntaxes, imageLinkResolver: imageLinkResolver, linkResolver: linkResolver); if (inlineOnly) { return renderToHtml(document.parseInline(markdown)); } else { var lines = markdown.replaceAll('\r\n', '\n').split('\n'); document.parseRefLinks(lines); var blocks = document.parseLines(lines); return renderToHtml(blocks); } } String renderToHtml(List nodes) => new HtmlRenderer().render(nodes); class HtmlRenderer implements NodeVisitor { static final _BLOCK_TAGS = new RegExp('blockquote|h1|h2|h3|h4|h5|h6|hr|p|pre'); StringBuffer buffer; HtmlRenderer(); String render(List nodes) { buffer = new StringBuffer(); for (final node in nodes) node.accept(this); return buffer.toString(); } void visitText(Text text) { buffer.write(text.text); } bool visitElementBefore(Element element) { if (!buffer.isEmpty && _BLOCK_TAGS.firstMatch(element.tag) != null) { buffer.write('\n'); } buffer.write('<${element.tag}'); final attributeNames = element.attributes.keys.toList(); attributeNames.sort((a, b) => a.compareTo(b)); for (final name in attributeNames) { buffer.write(' $name="${element.attributes[name]}"'); } if (element.isEmpty) { buffer.write(' />'); return false; } else { buffer.write('>'); return true; } } void visitElementAfter(Element element) { buffer.write('${element.tag}>'); } }