summaryrefslogtreecommitdiffstats
path: root/system/helpers/typography_helper.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-20 02:53:22 +0200
committeradmin <devnull@localhost>2006-10-20 02:53:22 +0200
commitf4c010098af532d9eb843743ef6bb8ed05689765 (patch)
tree42af3a844621b4419b3ba3088cdcf392b00972c3 /system/helpers/typography_helper.php
parentd54078fff55f74ee4fd320b27f8129b48bdcd3fa (diff)
Diffstat (limited to 'system/helpers/typography_helper.php')
-rw-r--r--system/helpers/typography_helper.php10
1 files changed, 8 insertions, 2 deletions
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('#(<p>\n*</p>)#', '', $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('#(<p.*?>)<p>#', "\\1", $str);
+ // Final clean up
$str = str_replace(
array(
'</p></p>',