summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2015-02-19 16:27:08 +0100
committerUrban Müller2015-02-19 16:27:08 +0100
commit49636e22e749749ab70b748e81ec3c21fd3aa29f (patch)
treeee1bbc482e957599d18786bb56c1405187a1f803
parent004a5fcb7849a4062e016faaa7a61f0c9acf0444 (diff)
downloaditools-49636e22e749749ab70b748e81ec3c21fd3aa29f.tar.gz
itools-49636e22e749749ab70b748e81ec3c21fd3aa29f.tar.bz2
itools-49636e22e749749ab70b748e81ec3c21fd3aa29f.zip
guarantee valid html comments
-rw-r--r--it_html.class10
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('--' => "&#45;&#45;", $string) . "-->";
+}
+
# internal: strip spans added by debug params
function _strip_tags($html)
{