diff options
author | Urban Müller | 2008-10-13 11:58:32 +0000 |
---|---|---|
committer | Urban Müller | 2008-10-13 11:58:32 +0000 |
commit | 0a96d92de2b9da61ffef430436c120ab7e17b4f3 (patch) | |
tree | 911262dc68d2f0c7ff7a6a5cd00632a2907f7e30 | |
parent | 0f392cf619e6c5227f47c497c4049d4d23c681a6 (diff) | |
download | itools-0a96d92de2b9da61ffef430436c120ab7e17b4f3.tar.gz itools-0a96d92de2b9da61ffef430436c120ab7e17b4f3.tar.bz2 itools-0a96d92de2b9da61ffef430436c120ab7e17b4f3.zip |
provide source line as title
-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; } |