X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhtml_parser.cpp;h=49ef67044a8287d27fd6055c42036318d2015337;hb=8bcd4c3e063e932b2f80f9491ec0af66d3da5c2e;hp=8d91a2c25787f8b5e480bd969796faa9ecf101df;hpb=213d7bae1233185595186f881a150ee238dac64f;p=metaproxy-moved-to-github.git diff --git a/src/html_parser.cpp b/src/html_parser.cpp index 8d91a2c..49ef670 100644 --- a/src/html_parser.cpp +++ b/src/html_parser.cpp @@ -130,7 +130,7 @@ static int tagAttrs (mp::HTMLParserEvent & event, const char *attr_value; int val_len; i = skipSpace (cp); - while (cp[i] && cp[i] != '>') + while (cp[i] && cp[i] != '>' && cp[i] != '/') { int nor = skipAttribute (cp+i, attr_name, &attr_value, &val_len); i += nor; @@ -176,11 +176,16 @@ static int tagStart (mp::HTMLParserEvent & event, static int tagEnd (mp::HTMLParserEvent & event, const char *tagName, const char *cp) { int i = 0; + int close_it = 0; while (cp[i] && cp[i] != '>') + { + if (cp[i] == '/') + close_it = 1; i++; + } if (cp[i] == '>') { - event.anyTagEnd(tagName); + event.anyTagEnd(tagName, close_it); i++; } return i;