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

Unified Diff: utils/markdown/lib.dart

Issue 8725007: Lots of stuff hooking up markdown to dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to awesome reviews. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/markdown/inline_parser.dart ('k') | utils/markdown/markdown.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/markdown/lib.dart
diff --git a/utils/markdown/lib.dart b/utils/markdown/lib.dart
index b53003fc58d3ed8a6720d16427ad7a709a2d6e42..6c2ddc31c93f183d1d66e6f3450a2f2a4261fce2 100644
--- a/utils/markdown/lib.dart
+++ b/utils/markdown/lib.dart
@@ -29,6 +29,12 @@ String escapeHtml(String html) {
.replaceAll('>', '>');
}
+var _implicitLinkResolver;
+
+Node setImplicitLinkResolver(Node resolver(String text)) {
+ _implicitLinkResolver = resolver;
+}
+
/// Maintains the context needed to parse a markdown document.
class Document {
final Map<String, Link> refLinks;
@@ -37,10 +43,10 @@ class Document {
: refLinks = <String, Link>{};
parseRefLinks(List<String> lines) {
- /// This is a hideous regex. It matches:
- /// [id]: http:foo.com "some title"
- /// Where there may whitespace in there, and where the title may be in
- /// single quotes, double quotes, or parentheses.
+ // This is a hideous regex. It matches:
+ // [id]: http:foo.com "some title"
+ // Where there may whitespace in there, and where the title may be in
+ // single quotes, double quotes, or parentheses.
final indent = @'^[ ]{0,3}'; // Leading indentation.
final id = @'\[([^\]]+)\]'; // Reference id in [brackets].
final quote = @'"[^"]+"'; // Title in "double quotes".
@@ -96,9 +102,7 @@ class Document {
/// returning a list of AST nodes. For example, given ``"*this **is** a*
/// `markdown`"``, returns:
/// `<em>this <strong>is</strong> a</em> <code>markdown</code>`.
- List<Node> parseInline(String text) {
- return new InlineParser(text, this).parse();
- }
+ List<Node> parseInline(String text) => new InlineParser(text, this).parse();
}
class Link {
« no previous file with comments | « utils/markdown/inline_parser.dart ('k') | utils/markdown/markdown.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698