1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-07 06:43:02 +03:00

Made it so that html nodes with a single child do not insert a carriage

* HTMLtree.c: Made it so that html nodes with a single child do
not insert a carriage return before or after the child node.
This commit is contained in:
Chris Lahey
1999-12-01 09:51:45 +00:00
parent d293fd1dfb
commit 6dff214ed7

View File

@@ -235,11 +235,13 @@ htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
} }
if (cur->childs != NULL) { if (cur->childs != NULL) {
if ((cur->childs->type != HTML_TEXT_NODE) && if ((cur->childs->type != HTML_TEXT_NODE) &&
(cur->childs->type != HTML_ENTITY_REF_NODE)) (cur->childs->type != HTML_ENTITY_REF_NODE) &&
(cur->childs != cur->last))
xmlBufferWriteChar(buf, "\n"); xmlBufferWriteChar(buf, "\n");
htmlNodeListDump(buf, doc, cur->childs); htmlNodeListDump(buf, doc, cur->childs);
if ((cur->last->type != HTML_TEXT_NODE) && if ((cur->last->type != HTML_TEXT_NODE) &&
(cur->last->type != HTML_ENTITY_REF_NODE)) (cur->last->type != HTML_ENTITY_REF_NODE) &&
(cur->childs != cur->last))
xmlBufferWriteChar(buf, "\n"); xmlBufferWriteChar(buf, "\n");
} }
xmlBufferWriteChar(buf, "</"); xmlBufferWriteChar(buf, "</");