summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-09-24 19:54:50 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-09-24 19:54:50 +0200
commitc184b3beda28be9c5815fdfc1be7aa79c8b84b16 (patch)
treedfecba4496add66a40463fbca891021b2721f560
parent9976587c01b21e96b0b98b4155d72287f8033118 (diff)
renamed $ignore_elements to $inline_elements, and made more robust by including all valid inline HTML elements
-rw-r--r--system/libraries/Typography.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php
index eeb507d34..da100dc17 100644
--- a/system/libraries/Typography.php
+++ b/system/libraries/Typography.php
@@ -27,13 +27,13 @@
class CI_Typography {
// Block level elements that should not be wrapped inside <p> tags
- var $block_elements = 'address|blockquote|del|div|dl|fieldset|form|h\d|hr|ins|noscript|ol|p|pre|script|table|ul';
+ var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|ol|p|pre|script|table|ul';
// Elements that should not have <p> and <br /> tags within them.
var $skip_elements = 'p|pre|ol|ul|dl|table';
// Tags we want the parser to completely ignore when splitting the string.
- var $ignore_elements = 'a|b|i|em|strong|span|img|li';
+ var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|object|samp|select|span|strong|sub|sup|textarea|var';
/**
* Nothing to do here...
@@ -101,7 +101,7 @@ class CI_Typography {
// Convert "ignore" tags to temporary marker. The parser splits out the string at every tag
// it encounters. Certain inline tags, like image tags, links, span tags, etc. will be
// adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG}
- $str = preg_replace("#<(/*)(".$this->ignore_elements.")#i", "{@TAG}\\1\\2", $str);
+ $str = preg_replace("#<(/*)(".$this->inline_elements.")#i", "{@TAG}\\1\\2", $str);
// Split the string at every tag. This expression creates an array with this prototype:
//