@@ -163,7 +163,6 @@ class Documentation {
163163 final String raw;
164164 final String asHtml;
165165 final String asOneLiner;
166- final bool hasMoreThanOneLineDocs;
167166
168167 factory Documentation (String markdown) {
169168 String tempHtml = _renderMarkdownToHtml (markdown);
@@ -175,8 +174,7 @@ class Documentation {
175174 return new Documentation ._internal (element.documentation, tempHtml);
176175 }
177176
178- Documentation ._(
179- this .raw, this .asHtml, this .hasMoreThanOneLineDocs, this .asOneLiner);
177+ Documentation ._(this .raw, this .asHtml, this .asOneLiner);
180178
181179 factory Documentation ._internal (String markdown, String rawHtml) {
182180 var asHtmlDocument = parse (rawHtml);
@@ -206,18 +204,14 @@ class Documentation {
206204 }
207205 var asHtml = asHtmlDocument.body.innerHtml;
208206
209- // Fixes issue with line ending differences between mac and windows, affecting tests
207+ // Fixes issue with line ending differences between mac and windows.
210208 if (asHtml != null ) asHtml = asHtml.trim ();
211209
212- var asOneLiner = '' ;
213- var moreThanOneLineDoc = asHtmlDocument.body.children.length > 1 ;
210+ var asOneLiner = asHtmlDocument.body.children.isEmpty
211+ ? ''
212+ : asHtmlDocument.body.children.first.innerHtml;
214213
215- if (asHtmlDocument.body.children.isNotEmpty) {
216- asOneLiner = asHtmlDocument.body.children.first.innerHtml;
217- }
218-
219- return new Documentation ._(
220- markdown, asHtml, moreThanOneLineDoc, asOneLiner);
214+ return new Documentation ._(markdown, asHtml, asOneLiner);
221215 }
222216}
223217
0 commit comments