diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-06-13 21:11:59 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-06-13 21:11:59 +0000 |
commit | 02bb170a8bad0b7fdb302398ad162271da502d5e (patch) | |
tree | 17ab4abd39ca630a86e3586a253b90f6bca0641b /HTMLtree.c | |
parent | 95d845f3ad6059e53b8cff4d1ae943e8d2d6136b (diff) | |
download | android_external_libxml2-02bb170a8bad0b7fdb302398ad162271da502d5e.tar.gz android_external_libxml2-02bb170a8bad0b7fdb302398ad162271da502d5e.tar.bz2 android_external_libxml2-02bb170a8bad0b7fdb302398ad162271da502d5e.zip |
- HTMLparser.[ch] HTMLtree.c: stored the inline/block property
of element and use it to avoid outputting formatting spaces at
the wrong place. Implemented the format parameter for HTML save.
- result/HTML/doc2.htm result/HTML/doc3.htm result/HTML/fp40.htm
result/HTML/script.html result/HTML/test2.html result/HTML/test3.html
result/HTML/wired.html: of course this impact the result of a
number of HTML tests
Daniel
Diffstat (limited to 'HTMLtree.c')
-rw-r--r-- | HTMLtree.c | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -527,7 +527,8 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, if ((info != NULL) && (info->empty)) { xmlBufferWriteChar(buf, ">"); - if (cur->next != NULL) { + if ((format) && (info != NULL) && (!info->isinline) && + (cur->next != NULL)) { if ((cur->next->type != HTML_TEXT_NODE) && (cur->next->type != HTML_ENTITY_REF_NODE)) xmlBufferWriteChar(buf, "\n"); @@ -544,7 +545,8 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, xmlBufferWriteCHAR(buf, cur->name); xmlBufferWriteChar(buf, ">"); } - if (cur->next != NULL) { + if ((format) && (info != NULL) && (!info->isinline) && + (cur->next != NULL)) { if ((cur->next->type != HTML_TEXT_NODE) && (cur->next->type != HTML_ENTITY_REF_NODE)) xmlBufferWriteChar(buf, "\n"); @@ -567,12 +569,14 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, } } if (cur->children != NULL) { - if ((cur->children->type != HTML_TEXT_NODE) && + if ((format) && (info != NULL) && (!info->isinline) && + (cur->children->type != HTML_TEXT_NODE) && (cur->children->type != HTML_ENTITY_REF_NODE) && (cur->children != cur->last)) xmlBufferWriteChar(buf, "\n"); htmlNodeListDump(buf, doc, cur->children, format); - if ((cur->last->type != HTML_TEXT_NODE) && + if ((format) && (info != NULL) && (!info->isinline) && + (cur->last->type != HTML_TEXT_NODE) && (cur->last->type != HTML_ENTITY_REF_NODE) && (cur->children != cur->last)) xmlBufferWriteChar(buf, "\n"); @@ -580,7 +584,8 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, xmlBufferWriteChar(buf, "</"); xmlBufferWriteCHAR(buf, cur->name); xmlBufferWriteChar(buf, ">"); - if (cur->next != NULL) { + if ((format) && (info != NULL) && (!info->isinline) && + (cur->next != NULL)) { if ((cur->next->type != HTML_TEXT_NODE) && (cur->next->type != HTML_ENTITY_REF_NODE)) xmlBufferWriteChar(buf, "\n"); @@ -997,7 +1002,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, if ((info != NULL) && (info->empty)) { xmlOutputBufferWriteString(buf, ">"); - if (cur->next != NULL) { + if ((format) && (!info->isinline) && (cur->next != NULL)) { if ((cur->next->type != HTML_TEXT_NODE) && (cur->next->type != HTML_ENTITY_REF_NODE) && (cur->parent != NULL) && @@ -1016,7 +1021,8 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlOutputBufferWriteString(buf, (const char *)cur->name); xmlOutputBufferWriteString(buf, ">"); } - if (cur->next != NULL) { + if ((format) && (cur->next != NULL) && + (info != NULL) && (!info->isinline)) { if ((cur->next->type != HTML_TEXT_NODE) && (cur->next->type != HTML_ENTITY_REF_NODE) && (cur->parent != NULL) && @@ -1040,13 +1046,15 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, #endif } if (cur->children != NULL) { - if ((cur->children->type != HTML_TEXT_NODE) && + if ((format) && (info != NULL) && (!info->isinline) && + (cur->children->type != HTML_TEXT_NODE) && (cur->children->type != HTML_ENTITY_REF_NODE) && (cur->children != cur->last) && (!xmlStrEqual(cur->name, BAD_CAST "pre"))) xmlOutputBufferWriteString(buf, "\n"); htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format); - if ((cur->last->type != HTML_TEXT_NODE) && + if ((format) && (info != NULL) && (!info->isinline) && + (cur->last->type != HTML_TEXT_NODE) && (cur->last->type != HTML_ENTITY_REF_NODE) && (cur->children != cur->last) && (!xmlStrEqual(cur->name, BAD_CAST "pre"))) @@ -1055,7 +1063,8 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlOutputBufferWriteString(buf, "</"); xmlOutputBufferWriteString(buf, (const char *)cur->name); xmlOutputBufferWriteString(buf, ">"); - if (cur->next != NULL) { + if ((format) && (info != NULL) && (!info->isinline) && + (cur->next != NULL)) { if ((cur->next->type != HTML_TEXT_NODE) && (cur->next->type != HTML_ENTITY_REF_NODE) && (cur->parent != NULL) && |