| Index: third_party/pkg/markdown/lib/src/document.dart
|
| diff --git a/third_party/pkg/markdown/lib/markdown.dart b/third_party/pkg/markdown/lib/src/document.dart
|
| similarity index 67%
|
| copy from third_party/pkg/markdown/lib/markdown.dart
|
| copy to third_party/pkg/markdown/lib/src/document.dart
|
| index 01de970769cb40b9207ad92615fbb42c3a7e0cc7..7ed01ca8f61a49eae1f78472cad4f1bdc15dd60d 100644
|
| --- a/third_party/pkg/markdown/lib/markdown.dart
|
| +++ b/third_party/pkg/markdown/lib/src/document.dart
|
| @@ -1,36 +1,8 @@
|
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| -// 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.
|
| +library markdown.document;
|
|
|
| -/// Parses text in a markdown-like format and renders to HTML.
|
| -library markdown;
|
| -
|
| -// TODO(rnystrom): Use "package:" URL (#4968).
|
| -part 'src/markdown/ast.dart';
|
| -part 'src/markdown/block_parser.dart';
|
| -part 'src/markdown/html_renderer.dart';
|
| -part 'src/markdown/inline_parser.dart';
|
| -
|
| -typedef Node Resolver(String name);
|
| -
|
| -/// Converts the given string of markdown to HTML.
|
| -String markdownToHtml(String markdown, {inlineSyntaxes, linkResolver}) {
|
| - final document = new Document(inlineSyntaxes: inlineSyntaxes,
|
| - linkResolver: linkResolver);
|
| -
|
| - // Replace windows line endings with unix line endings, and split.
|
| - final lines = markdown.replaceAll('\r\n','\n').split('\n');
|
| - document.parseRefLinks(lines);
|
| - final blocks = document.parseLines(lines);
|
| - return renderToHtml(blocks);
|
| -}
|
| -
|
| -/// Replaces `<`, `&`, and `>`, with their HTML entity equivalents.
|
| -String escapeHtml(String html) {
|
| - return html.replaceAll('&', '&')
|
| - .replaceAll('<', '<')
|
| - .replaceAll('>', '>');
|
| -}
|
| +import 'ast.dart';
|
| +import 'block_parser.dart';
|
| +import 'inline_parser.dart';
|
|
|
| /// Maintains the context needed to parse a markdown document.
|
| class Document {
|
|
|