#define SPACECHR " \t\r\n\f"
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html
namespace metaproxy_1 {
class HTMLParser::Rep {
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;
}
const char *cp)
{
int i = skipSpace(cp);
- while (cp[i] && cp[i] != '>' && cp[i] != '/' && cp[i] != '<')
+ while (cp[i] && !strchr("/><", cp[i]))
{
const char *attr_name = cp + i;
int attr_len;
{
int i = 0;
int close_it = 0;
- for (; cp[i] && cp[i] != '/' && cp[i] != '>' && cp[i] != '<'; i++)
+ for (; cp[i] && !strchr("/><", cp[i]); i++)
;
if (i > 0)
{