Chromium Code Reviews| 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)) { |
|
Jennifer Messerly
2011/11/28 23:08:13
what's the deal here? Is this a frog bug? (maybe a
Bob Nystrom
2011/11/29 02:44:08
As in why didn't I just make it a field? Hmm. I di
|
| + _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 { |