Skip to content

Commit

Permalink
fix <br> not producing new line
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed Jun 28, 2021
1 parent b9fce92 commit b472e03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Helper/JString.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class JString
*/
public static function cleanse(string $string): string
{
// <br> to new line
$string = str_replace(
["<br>", "<br />", "<br/>", "<br >"], "\\n", $string
);

// remove control characters
$string = preg_replace('~[[:cntrl:]]~', "", $string);

Expand Down

0 comments on commit b472e03

Please sign in to comment.