diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-09-26 00:14:01 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-09-26 00:14:01 +0200 |
commit | e07ba013ad4ee70ff26ce6ee081cc0d5396a7e03 (patch) | |
tree | cc4f2ae5c8df5ae1c5a5fc90387d22e8477475e9 /system/libraries/Typography.php | |
parent | cce31591f865bcf0130945fcfb44335bfd964018 (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/Typography.php')
-rw-r--r-- | system/libraries/Typography.php | 6 |
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); |