Index: pkg/analyzer/lib/src/generated/parser.dart |
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart |
index d3f747517b61ae2e1f002434f72d482c97e7f9f7..8e24b98c06697bbe362c40ffa2116bc2ebed9176 100644 |
--- a/pkg/analyzer/lib/src/generated/parser.dart |
+++ b/pkg/analyzer/lib/src/generated/parser.dart |
@@ -5178,9 +5178,22 @@ class Parser { |
List<CommentReference> _parseCommentReferences( |
List<DocumentationCommentToken> tokens) { |
List<CommentReference> references = <CommentReference>[]; |
+ bool isInGitHubCodeBlock = false; |
for (DocumentationCommentToken token in tokens) { |
String comment = token.lexeme; |
- comment = _removeCodeBlocksGitHub(comment); |
+ // Skip GitHub code blocks. |
+ // https://help.github.com/articles/creating-and-highlighting-code-blocks/ |
+ if (tokens.length != 1) { |
+ if (comment.indexOf('```') != -1) { |
Brian Wilkerson
2016/09/01 21:06:58
Do we care about the case where the tripled-quote
scheglov
2016/09/01 21:14:22
It seems even less used case for me.
So, no, not n
|
+ isInGitHubCodeBlock = !isInGitHubCodeBlock; |
+ } |
+ if (isInGitHubCodeBlock) { |
+ continue; |
+ } |
+ } |
+ // Remove GitHub include code. |
+ comment = _removeGitHubInlineCode(comment); |
+ // Find references. |
int length = comment.length; |
List<List<int>> codeBlockRanges = _getCodeBlockRanges(comment); |
int leftIndex = comment.indexOf('['); |
@@ -8883,7 +8896,7 @@ class Parser { |
return token; |
} |
- String _removeCodeBlocksGitHub(String comment) { |
+ String _removeGitHubInlineCode(String comment) { |
int index = 0; |
while (true) { |
int beginIndex = comment.indexOf('`', index); |