code: public function convertLineFeeds($strComment)
  	{
  		$strComment = nl2br_pre($strComment);
  
  		// Use paragraphs to generate new lines
  		if (strncmp('<p>', $strComment, 3) !== 0)
  		{
  			$strComment = '<p>'. $strComment .'</p>';
  		}
  
  		$arrReplace = array
  		(
  			'@<br>\s?<br>\s?@' => "</p>\n<p>", // Convert two linebreaks into a new paragraph
  			'@\s?<br></p>@'    => '</p>',      // Remove BR tags before closing P tags
  			'@<p><div@'        => '<div',      // Do not nest DIVs inside paragraphs
  			'@</div></p>@'     => '</div>'     // Do not nest DIVs inside paragraphs
  		);
  
  		return preg_replace(array_keys($arrReplace), array_values($arrReplace), $strComment);
  	}
docs: Convert line feeds to <br /> tags
  
  @param string $strComment
  
  @return string