X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fhtml_parser.cpp;h=4d4e3a770dd68c6dd3736da4ab92992d67fd6c2a;hb=40b194f21cadfda4f9b034e1a0742c570889b731;hp=a720c5622f69894936a3d40189f67ea462054c64;hpb=b8f4ac1af9456465a24ecd338fd998e292030abf;p=metaproxy-moved-to-github.git diff --git a/src/html_parser.cpp b/src/html_parser.cpp index a720c56..4d4e3a7 100644 --- a/src/html_parser.cpp +++ b/src/html_parser.cpp @@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define SPACECHR " \t\r\n\f" +// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html namespace metaproxy_1 { class HTMLParser::Rep { @@ -95,7 +96,7 @@ static int skipSpace(const char *cp) static int skipName(const char *cp) { int i; - for (i = 0; cp[i] && !strchr(SPACECHR "/>=", cp[i]); i++) + for (i = 0; cp[i] && !strchr(SPACECHR "/><=", cp[i]); i++) ; return i; } @@ -146,7 +147,7 @@ int mp::HTMLParser::Rep::tagAttrs(HTMLParserEvent &event, const char *cp) { int i = skipSpace(cp); - while (cp[i] && cp[i] != '>' && cp[i] != '/') + while (cp[i] && !strchr("/><", cp[i])) { const char *attr_name = cp + i; int attr_len; @@ -174,7 +175,7 @@ int mp::HTMLParser::Rep::tagEnd(HTMLParserEvent &event, { int i = 0; int close_it = 0; - for (; cp[i] && cp[i] != '/' && cp[i] != '>'; i++) + for (; cp[i] && !strchr("/><", cp[i]); i++) ; if (i > 0) { @@ -287,6 +288,10 @@ void mp::HTMLParser::Rep::parse_str(HTMLParserEvent &event, const char *cp) tagText(event, text_start, cp); } +mp::HTMLParserEvent::~HTMLParserEvent() +{ +} + /* * Local variables: * c-basic-offset: 4