adds a `$maxLines` parameter to limit the number of lines to display in comments in case the comment has a bunch of newlines