if (!nest)
{
if (i == 6 && !yaz_strncasecmp(cp, "script", i))
- nest = true;
- else
{
- continue;
+ int ws = skipSpace(cp + 6);
+ if (cp[ws + 6] == '>')
+ nest = true; /* really terminated */
}
+ if (!nest)
+ continue;
}
tagText(event, text_start, cp - 2);
event.closeTag(cp, i);
out.append(value, len);
}
};
-#if 0
+
BOOST_AUTO_TEST_CASE( test_html_parser_1 )
{
try
BOOST_CHECK (false);
}
}
-#endif
+
BOOST_AUTO_TEST_CASE( test_html_parser_7 )
{
try
{
mp::HTMLParser hp;
const char* html =
- "<html><script>x=1; for (i=0;i<x;i++) ;\nx=2;\n</script></html>";
+ "<html><Script>x=1; for (i=0;i<x;i++) </y>;"
+ "</SCRIPT ;>"
+ "</1>\nx=2;\n</Script></html>";
const char* expected = html;
MyEvent e;
- hp.set_verbose(1);
+ hp.set_verbose(0);
hp.parse(e, html);
BOOST_CHECK_EQUAL(std::string(expected), e.out);