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

Unified Diff: pkg/docgen/lib/docgen.dart

Issue 161213002: Tolerate a comment with no end paragraph tag when generating preview (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use a hard-coded comment preview unavailable message instead Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index d316780fd4e16c639c3e3d74768e2278cbdca542..a9f8848b65194b3c3d47cc65e0b3be36b1a3a380 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -938,7 +938,9 @@ abstract class Indexable extends MirrorBased {
var finalMap = { 'name' : name, 'qualifiedName' : qualifiedName };
if (comment != '') {
var index = comment.indexOf('</p>');
- finalMap['preview'] = '${comment.substring(0, index)}</p>';
+ finalMap['preview'] = index > 0 ?
+ '${comment.substring(0, index)}</p>' :
+ '<p><i>Comment preview not available</i></p>';
}
return finalMap;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698