From 90804e0d92b625211e83041c8224f7f7dfd9b657 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 9 Apr 2004 16:22:12 +0000 Subject: [PATCH] some cleanup on save --- includes/Parser.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/Parser.php b/includes/Parser.php index 3c7b67a45e..eb3c613d84 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1786,7 +1786,16 @@ class Parser } $stripState = false; - $text = str_replace("\r\n", "\n", $text); + $pairs = array( + "\r\n" => "\n", + ); + $text = str_replace(array_keys($pairs), array_values($pairs), $text); + // now with regexes + $pairs = array( + "//i" => '
', + "/
/i" => "
", + ); + $text = preg_replace(array_keys($pairs), array_values($pairs), $text); $text = $this->strip( $text, $stripState, false ); $text = $this->pstPass2( $text, $user ); $text = $this->unstrip( $text, $stripState ); -- 2.20.1