diff options
-rw-r--r-- | it_html.class | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/it_html.class b/it_html.class index 0d137c9..38dae0a 100644 --- a/it_html.class +++ b/it_html.class @@ -258,7 +258,11 @@ function _tag($name, $args) if ($this->p['prettyprint'] && $newline && (substr($data, -1, 1) == "\n") && (strpos($data, '<textarea') === false && strpos($data, '<pre') === false) && ($data != strip_tags($data))) $data = str_replace("\n", "\n ", "\n" . trim($data)) . "\n"; - $result = "<$name"; + # debugging aid: add backtrace + if ($levels = intval($GLOBALS['debug_srclines'])) + $attr = array('title' => it_debug::backtrace(array('levels' => $levels, 'skipfiles' => "_html\\.class"))) + $attr; + + $result .= "<$name"; # add attributes. If $value === true, use key only (<td nowrap> instead of <td nowrap=""> for old html, <td nowrap="nowrap"> for xhtml style) foreach($attr as $key => $value) @@ -279,9 +283,6 @@ function _tag($name, $args) else $result .= " />$newline"; - if ($levels = intval($GLOBALS['debug_srclines'])) - $result = "<!-- " . it_html::Q(it_debug::backtrace(array('levels' => $levels, 'skipfiles' => "_html\\.class"))) . " -->" . $result; # Hack: Filter it_html and derived classes - return $result; } |