File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1346,17 +1346,20 @@ class PackageBackend {
13461346 /// Limit the changelog to 10 lines, 75 characters each:
13471347 final lines = text.split ('\n ' );
13481348 final excerpt = lines
1349+ // prevent accidental HTML-tag creation
1350+ .map ((line) => line
1351+ .replaceAll ('<' , '[' )
1352+ .replaceAll ('>' , ']' )
1353+ .replaceAll ('&' , ' ' )
1354+ .trim ())
13491355 // filter empty or decorative lines to maximalize usefulness
13501356 .where ((line) =>
13511357 line.isNotEmpty &&
1358+ line != '-' && // empty list item
1359+ line != '1.' && // empty list item
13521360 ! line.startsWith ('```' ) && // also removes the need to escape it
13531361 ! line.startsWith ('---' ))
13541362 .take (10 )
1355- // prevent accidental HTML-tag creation
1356- .map ((line) => line
1357- .replaceAll ('<' , '[' )
1358- .replaceAll ('>' , ']' )
1359- .replaceAll ('&' , ' ' ))
13601363 .map ((line) =>
13611364 line.length < 76 ? line : '${line .substring (0 , 70 )}[...]' )
13621365 .join ('\n ' );
You can’t perform that action at this time.
0 commit comments