From 30defddf9b1eefed8f2bb3da8b14a1b0a3b087a4 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 25 Oct 2007 00:05:23 +0000 Subject: Handle nonewlinetags in it_html::configure() --- it_html.class | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'it_html.class') 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' => '' ); - $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, '