diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2008-12-08 19:16:20 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2008-12-08 19:16:20 -0300 |
commit | 0a11f8ec8fb01f4fac067e425bc725e70ba73258 (patch) | |
tree | 5550b2683d7144abeef82bf36c09a3eb51efe7ab /src | |
parent | 4e93afcf54baaa4d2b689357ec47fd3ec585e44f (diff) |
Made the parser recognize "[^ ]/>"-terminated XML elements. Part #2.
Diffstat (limited to 'src')
-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 */ |