X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fhtml-parse.c;h=4ae7afe77ac93d7cacb4c728865338993db68ee2;hb=0ce7b6bffc311d83871c75bfc52330354ff84615;hp=f9a5b0f5379129fcf7fe3e54baf65dee1a48293e;hpb=b1dd1c1bad905d3cfc32073b34e8eaaac0ffc418;p=wget diff --git a/src/html-parse.c b/src/html-parse.c index f9a5b0f5..4ae7afe7 100644 --- a/src/html-parse.c +++ b/src/html-parse.c @@ -638,6 +638,19 @@ map_html_tags (const char *text, int size, SKIP_WS (p); + if (*p == '/') + { + /* A slash at this point means the tag is about to be + closed. This is legal in XML and has been popularized + in HTML via XHTML. */ + /* */ + /* ^ */ + ADVANCE (p); + SKIP_WS (p); + if (*p != '>') + goto backout_tag; + } + /* Check for end of tag definition. */ if (*p == '>') break; @@ -654,7 +667,7 @@ map_html_tags (const char *text, int size, /* Establish bounds of attribute value. */ SKIP_WS (p); - if (NAME_CHAR_P (*p) || *p == '>') + if (NAME_CHAR_P (*p) || *p == '/' || *p == '>') { /* Minimized attribute syntax allows `=' to be omitted. For example,