Chip turner indicated that XHTML1 serialization rule for style actually

* tree.c: Chip turner indicated that XHTML1 serialization
  rule for style actually break on both IE and Mozilla,
  try to avoid the rule if escaping ain't necessary
Daniel
This commit is contained in:
Daniel Veillard 2002-12-04 15:10:40 +00:00
parent 8efff67157
commit 64b3528286
2 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,9 @@
Wed Dec 4 16:08:49 CET 2002 Daniel Veillard <daniel@veillard.com>
* tree.c: Chip turner indicated that XHTML1 serialization
rule for style actually break on both IE and Mozilla,
try to avoid the rule if escaping ain't necessary
Wed Dec 4 12:43:28 CET 2002 Daniel Veillard <daniel@veillard.com>
* nanhttp.c: handle HTTP URL escaping, problem reported by

21
tree.c
View File

@ -7092,11 +7092,22 @@ xhtmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
while (child != NULL) {
if ((child->type == XML_TEXT_NODE) ||
(child->type == XML_CDATA_SECTION_NODE)) {
xmlOutputBufferWriteString(buf, "<![CDATA[");
if (child->content != NULL)
xmlOutputBufferWriteString(buf,
(const char *)child->content);
xmlOutputBufferWriteString(buf, "]]>");
/*
* Apparently CDATA escaping for style just break on IE,
* mozilla and galeon, so ...
*/
if (xmlStrEqual(cur->name, BAD_CAST "style") &&
(xmlStrchr(child->content, '<') == NULL) &&
(xmlStrchr(child->content, '>') == NULL) &&
(xmlStrchr(child->content, '&') == NULL)) {
xhtmlNodeDumpOutput(buf, doc, child, 0, 0, encoding);
} else {
xmlOutputBufferWriteString(buf, "<![CDATA[");
if (child->content != NULL)
xmlOutputBufferWriteString(buf,
(const char *)child->content);
xmlOutputBufferWriteString(buf, "]]>");
}
} else {
xhtmlNodeDumpOutput(buf, doc, child, 0, 0, encoding);
}