summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-09-26 00:14:01 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-09-26 00:14:01 +0200
commite07ba013ad4ee70ff26ce6ee081cc0d5396a7e03 (patch)
treecc4f2ae5c8df5ae1c5a5fc90387d22e8477475e9 /system/libraries
parentcce31591f865bcf0130945fcfb44335bfd964018 (diff)
added check that content is surrounded by a valid block level element, and if not, wrapped in paragraph tags
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Typography.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php
index 6b18a2dfd..94c9de01b 100644
--- a/system/libraries/Typography.php
+++ b/system/libraries/Typography.php
@@ -143,6 +143,12 @@ class CI_Typography {
$str .= $this->_format_newlines($chunk);
}
+ // is the whole of the content inside a block level element?
+ if ( ! preg_match("/^<(?:".$this->block_elements.")/i", $str, $match))
+ {
+ $str = "<p>{$str}</p>";
+ }
+
// Convert quotes, elipsis, and em-dashes
$str = $this->format_characters($str);