From e44227a3efb9fa7beb3b3411aebb86051f90e484 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 4 Aug 2020 08:59:57 -0700 Subject: [PATCH] Fix #2281; Do not process templates when not processing tools --- lib/src/model/comment_processable.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/model/comment_processable.dart b/lib/src/model/comment_processable.dart index faa656f859..3c8902c3e1 100644 --- a/lib/src/model/comment_processable.dart +++ b/lib/src/model/comment_processable.dart @@ -35,7 +35,15 @@ mixin CommentProcessable on Documentable, Warnable, Locatable, SourceCodeMixin { /// `{@}`-style directives, except `{@tool}`, returning the processed result. String processCommentWithoutTools(String documentationComment) { var docs = stripComments(documentationComment); - docs = processCommentDirectives(docs); + if (!docs.contains('{@')) { + return docs; + } + docs = _injectExamples(docs); + docs = _injectYouTube(docs); + docs = _injectAnimations(docs); + // TODO(srawlins): Processing templates here causes #2281. But leaving them + // unprocessed causes #2272. + docs = _stripHtmlAndAddToIndex(docs); return docs; }