From e07ba013ad4ee70ff26ce6ee081cc0d5396a7e03 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 25 Sep 2008 22:14:01 +0000 Subject: added check that content is surrounded by a valid block level element, and if not, wrapped in paragraph tags --- system/libraries/Typography.php | 6 ++++++ 1 file changed, 6 insertions(+) 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 = "

{$str}

"; + } + // Convert quotes, elipsis, and em-dashes $str = $this->format_characters($str); -- cgit v1.2.3-24-g4f1b