diff options
-rw-r--r-- | src/html.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/html.cc b/src/html.cc index b3ac1ae0..2e486ba0 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1349,7 +1349,7 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx) /* Close this and only this tag */ html->CloseOneTag = true; - MSG("Close: %*s%s\n", html->stack->size()," ",Tags[toptag_idx].name); + _MSG("Close: %*s%s\n", html->stack->size()," ",Tags[toptag_idx].name); Tags[toptag_idx].close (html, toptag_idx); } @@ -3403,7 +3403,7 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag) if (tag_idx != new_idx || IsCloseTag) { /* implicit open */ Html_force_push_tag(html, tag_idx); - MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name); + _MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name); Tags[tag_idx].open (html, tag, strlen(tag)); } } @@ -3416,7 +3416,7 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag) if (tag_idx != new_idx || IsCloseTag) { /* implicit open of the head element */ Html_force_push_tag(html, tag_idx); - MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name); + _MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name); Tags[tag_idx].open (html, tag, strlen(tag)); } } @@ -3433,7 +3433,7 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag) if (tag_idx != new_idx || IsCloseTag) { /* implicit open */ Html_force_push_tag(html, tag_idx); - MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name); + _MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name); Tags[tag_idx].open (html, tag, strlen(tag)); } } @@ -3486,7 +3486,7 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) Html_push_tag(html, ni); /* Call the open function for this tag */ - MSG("Open : %*s%s\n", html->stack->size(), " ", Tags[ni].name); + _MSG("Open : %*s%s\n", html->stack->size(), " ", Tags[ni].name); Tags[ni].open (html, tag, tagsize); if (html->stop_parser) break; @@ -3530,7 +3530,9 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) /* Test for </x>, ReqTagClose, <x /> and <x/> */ if (*start == '/' || /* </x> */ html->ReqTagClose || /* request */ - tag[tagsize - 2] == '/') { /* XML */ + (tag[tagsize-2] == '/' && /* XML: */ + (strchr(" \"'", tag[tagsize-3]) || /* [ "']/> */ + (size_t)tagsize == strlen(Tags[ni].name) + 3))) { /* <x/> */ Html_tag_cleanup_at_close(html, ni); /* This was a close tag */ |