summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
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);