|
|
@@ -25,6 +25,10 @@ class HtmlHelper
|
|
|
*/
|
|
|
public static function wrapNewlines($content, $tag = 'p', $htmlOptions = [])
|
|
|
{
|
|
|
+ $content = trim($content);
|
|
|
+ if ($content === '') {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
$filteredNewLinesContent = preg_replace('/((\r?\n)(?:\r?\n))/', '$2', $content);
|
|
|
$lines = preg_split('/\r?\n/', $filteredNewLinesContent);
|
|
|
|