Chromium Code Reviews| Index: pkg/docgen/lib/docgen.dart |
| diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart |
| index 271684dd0729eca6b767f1bde97e676279e40497..d065698374a04fe626280838e4d6bc69d06043cf 100644 |
| --- a/pkg/docgen/lib/docgen.dart |
| +++ b/pkg/docgen/lib/docgen.dart |
| @@ -47,6 +47,10 @@ ClassMirror _currentClass; |
| /// Current member being documented to be used for comment links. |
| MemberMirror _currentMember; |
| +/// Add support for [:foo:]-style code to the markdown parser. |
|
Emily Fortuna
2013/08/02 23:26:55
nit: can we make this comment slightly clearer: su
Tate Mandel
2013/08/02 23:54:36
Done.
|
| +List<markdown.InlineSyntax> markdownSyntaxes = |
| + [new markdown.CodeSyntax(r'\[:\s?((?:.|\n)*?)\s?:\]')]; |
| + |
| /// Resolves reference links in doc comments. |
| markdown.Resolver linkResolver; |
| @@ -323,7 +327,8 @@ String _commentToHtml(DeclarationMirror mirror) { |
| }); |
| commentText = commentText == null ? '' : |
| - markdown.markdownToHtml(commentText.trim(), linkResolver: linkResolver); |
| + markdown.markdownToHtml(commentText.trim(), linkResolver: linkResolver, |
| + inlineSyntaxes: markdownSyntaxes); |
| return commentText; |
| } |
| @@ -339,7 +344,12 @@ markdown.Node fixReference(String name, LibraryMirror currentLibrary, |
| else { |
| var classScope = currentClass == null ? |
| null : currentClass.lookupInScope(name); |
| - reference = classScope != null ? classScope.qualifiedName : name; |
| + if (classScope != null) reference = classScope.qualifiedName; |
|
Emily Fortuna
2013/08/02 23:26:55
if you have an else branch, go ahead and put the i
Tate Mandel
2013/08/02 23:54:36
Done.
|
| + else { |
| + var libraryScope = currentLibrary == null ? |
| + null : currentLibrary.lookupInScope(name); |
| + reference = libraryScope != null ? libraryScope.qualifiedName : name; |
| + } |
| } |
| return new markdown.Element.text('a', reference); |
| } |
| @@ -620,7 +630,7 @@ class Class extends Indexable { |
| */ |
| void makeValid() { |
| var library = entityMap[owner]; |
| - if (!library.classes.containsKey(name)) { |
| + if (library != null && !library.classes.containsKey(name)) { |
| this.isPrivate = true; |
| // Since we are now making the mixin a private class, make all elements |
| // with the mixin as an owner private too. |