From f4c010098af532d9eb843743ef6bb8ed05689765 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 00:53:22 +0000 Subject: --- system/helpers/typography_helper.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'system/helpers/typography_helper.php') diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 84ca0ed6f..ba6804873 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -223,7 +223,9 @@ class Auto_typography { $str .= $this->format_newlines($chunk); } - + // FINAL CLEAN UP + // IMPORTANT: DO NOT ALTER THE ORDER OF THE ITEMS BELOW! + /* * Clean up paragraph tags before/after "block" elements * @@ -239,10 +241,14 @@ class Auto_typography { // Convert Quotes and other characters $str = $this->format_characters($str); - // Final clean up + // Fix an artifact that happens during the paragraph replacement $str = preg_replace('#(

\n*

)#', '', $str); + + // If the user submitted their own paragraph tags with class data + // in them we will retain them instead of using our tags. $str = preg_replace('#()

#', "\\1", $str); + // Final clean up $str = str_replace( array( '

', -- cgit v1.2.3-24-g4f1b