diff options
author | Urban Müller | 2015-02-19 16:27:08 +0100 |
---|---|---|
committer | Urban Müller | 2015-02-19 16:27:08 +0100 |
commit | 49636e22e749749ab70b748e81ec3c21fd3aa29f (patch) | |
tree | ee1bbc482e957599d18786bb56c1405187a1f803 | |
parent | 004a5fcb7849a4062e016faaa7a61f0c9acf0444 (diff) | |
download | itools-49636e22e749749ab70b748e81ec3c21fd3aa29f.tar.gz itools-49636e22e749749ab70b748e81ec3c21fd3aa29f.tar.bz2 itools-49636e22e749749ab70b748e81ec3c21fd3aa29f.zip |
guarantee valid html comments
-rw-r--r-- | it_html.class | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/it_html.class b/it_html.class index 2a93473..0f29bab 100644 --- a/it_html.class +++ b/it_html.class @@ -88,7 +88,7 @@ function it_html($p = array()) 'use_it_state' => false, # If true, generate code needed by state.js (aka 'history iframe') 'srclines' => $GLOBALS['debug_srclines'], # append stackdump to each tag ); - $this->p['notexported'] = trim($p['notexported'] . ',configure,sanitize', ','); + $this->p['notexported'] = trim($p['notexported'] . ',configure,sanitize,comment', ','); # We know these doctypes. If you need something else, supply 'doctype' in p $this->doctypes = array( @@ -415,6 +415,14 @@ function select($tags, $options, $selected = null) return $this->_tag("select", array($tags, $html)); } +/** + * Outputs string as correctly quoted HTML comment + */ +function comment($string) +{ + return "<!--" . it::replace('--' => "--", $string) . "-->"; +} + # internal: strip spans added by debug params function _strip_tags($html) { |