| Index: third_party/pkg/markdown/lib/src/html_renderer.dart
|
| diff --git a/third_party/pkg/markdown/lib/src/markdown/html_renderer.dart b/third_party/pkg/markdown/lib/src/html_renderer.dart
|
| similarity index 70%
|
| rename from third_party/pkg/markdown/lib/src/markdown/html_renderer.dart
|
| rename to third_party/pkg/markdown/lib/src/html_renderer.dart
|
| index 5494394f36872b799bcd6efbd5febbc799c4b950..97b900b5881ea0a2eded1c74f2a8729389b13bc2 100644
|
| --- a/third_party/pkg/markdown/lib/src/markdown/html_renderer.dart
|
| +++ b/third_party/pkg/markdown/lib/src/html_renderer.dart
|
| @@ -2,7 +2,27 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -part of markdown;
|
| +library markdown.html_renderer;
|
| +
|
| +import 'ast.dart';
|
| +import 'document.dart';
|
| +
|
| +/// Converts the given string of markdown to HTML.
|
| +String markdownToHtml(String markdown, {inlineSyntaxes, linkResolver,
|
| + bool inlineOnly: false}) {
|
| + var document = new Document(inlineSyntaxes: inlineSyntaxes,
|
| + linkResolver: linkResolver);
|
| +
|
| + if (inlineOnly) {
|
| + return renderToHtml(document.parseInline(markdown));
|
| + } else {
|
| + // Replace windows line endings with unix line endings, and split.
|
| + var lines = markdown.replaceAll('\r\n','\n').split('\n');
|
| + document.parseRefLinks(lines);
|
| + var blocks = document.parseLines(lines);
|
| + return renderToHtml(blocks);
|
| + }
|
| +}
|
|
|
| String renderToHtml(List<Node> nodes) => new HtmlRenderer().render(nodes);
|
|
|
|
|