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

Unified Diff: third_party/pkg/markdown/lib/src/document.dart

Issue 189333002: pkg/docgen: update markdown to 0.5.1 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updates Created 6 years, 9 months 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 side-by-side diff with in-line comments
Download patch
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('&', '&amp;')
- .replaceAll('<', '&lt;')
- .replaceAll('>', '&gt;');
-}
+import 'ast.dart';
+import 'block_parser.dart';
+import 'inline_parser.dart';
/// Maintains the context needed to parse a markdown document.
class Document {
« no previous file with comments | « third_party/pkg/markdown/lib/src/block_parser.dart ('k') | third_party/pkg/markdown/lib/src/html_renderer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698