summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorChristian Schneider2007-10-25 00:05:23 +0000
committerChristian Schneider2007-10-25 00:05:23 +0000
commit30defddf9b1eefed8f2bb3da8b14a1b0a3b087a4 (patch)
treec3b834f62573b38d806b02be293544498575c2a6 /it_html.class
parentfc3265f71dbfea3a6fb9107fc05f55662b4a4761 (diff)
downloaditools-30defddf9b1eefed8f2bb3da8b14a1b0a3b087a4.tar.gz
itools-30defddf9b1eefed8f2bb3da8b14a1b0a3b087a4.tar.bz2
itools-30defddf9b1eefed8f2bb3da8b14a1b0a3b087a4.zip
Handle nonewlinetags in it_html::configure()
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class5
1 files changed, 3 insertions, 2 deletions
diff --git a/it_html.class b/it_html.class
index 9008b3e..0e64a45 100644
--- a/it_html.class
+++ b/it_html.class
@@ -65,7 +65,7 @@ function it_html($p = array())
'xhtml-mobile' => '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">'
);
- $this->hasnonewline = array_flip(explode(',', "dummy," . $this->p['nonewlinetags'])); # dummy keeps values > 0
+ $this->hasnonewline = array_flip(explode(',', $this->p['nonewlinetags']));
$notexported = array_flip(explode(',', "dummy," . $this->p['notexported'])); # dummy keeps values > 0
# Create global functions for _tags
@@ -105,6 +105,7 @@ function configure($p)
{
$p += array('name' => "it_html"); # XXX Copy and paste from constructor to keep PHP4 compatibility
$GLOBALS[$p['name']]->p = $p + (array)$GLOBALS[$p['name']]->p;
+ $GLOBALS[$p['name']]->hasnonewline = array_flip(explode(',', $GLOBALS[$p['name']]->p['nonewlinetags']));
}
/**
@@ -250,7 +251,7 @@ function _tag($name, $args)
{
list($data, $attr) = $this->_parse_args($args);
- $newline = $this->hasnonewline[$name] ? "" : "\n";
+ $newline = isset($this->hasnonewline[$name]) ? "" : "\n";
# Ultra XML PrettyPrinter 3000 [\] by SCA
if ($this->p['prettyprint'] && $newline && (substr($data, -1, 1) == "\n") && (strpos($data, '<textarea') === false) && ($data != strip_tags($data)))