Files

167 lines
4.5 KiB
JSON

[
{
"input": "<html>hello<br/>world<br/></html>",
"expected": "hello\nworld\n"
},
{
"input": "<html>using &lt;><br/></html>",
"expected": "using <>\n"
},
{
"input": "test <not br/>tag<br />",
"expected": "test tag\n"
},
{
"input": "<>< ><tag\n/>>hello world< br \n />",
"expected": ">hello world\n"
},
{
"input": "<head><title>ignore head</title><not head>xyz</not head></head><h1>&lt;body&gt;</h1>",
"expected": "<body>\n"
},
{
"input": "<p>what is &heartsuit;?</p><p>&#x000DF;&Abreve;&#914;&gamma; don&apos;t hurt me.</p>",
"expected": "what is ♥?\nßĂΒγ don't hurt me.\n"
},
{
"input": "<!--[if mso]><style type=\"text/css\">body, table, td, a, p, span, ul, li {font-family: Arial, sans-serif!important;}</style><![endif]-->this is <!-- <> < < < < ignore > -> here -->the actual<!--> text",
"expected": "this is the actual text"
},
{
"input": " < p > hello < / p > < p > world < / p > !!! < br > ",
"expected": "hello\nworld\n!!!\n"
},
{
"input": " <p>please unsubscribe <a href=#>here</a>.</p> ",
"expected": "please unsubscribe here.\n"
},
{
"input": "<style>body{color:red}</style><div>Hello</div>",
"expected": "Hello\n"
},
{
"input": "<style>body{color:red}</style><div>Hello</div><script>alert('x')</script><div>World</div>",
"expected": "Hello\nWorld\n"
},
{
"input": "<div>Hello</div><template><div>Hidden</div><style>.x{}</style></template><div>World</div>",
"expected": "Hello\nWorld\n"
},
{
"input": "<style type=\"text/css\">p { color: red; }</style><p>Hello world</p>",
"expected": "Hello world\n"
},
{
"input": "<script type=\"text/javascript\">var x = 1;</script><p>Hello world</p>",
"expected": "Hello world\n"
},
{
"input": "<STYLE TYPE=\"text/css\" media=\"screen\">.a{b:c}</STYLE>Hi",
"expected": "Hi"
},
{
"input": "<head lang=\"en\"><title>Title</title></head><body class=\"main\">Body</body>",
"expected": "Body"
},
{
"input": "<div>Hello</div><template id=\"row\"><div>Hidden</div></template><div>World</div>",
"expected": "Hello\nWorld\n"
},
{
"input": "line one<br class=\"x\">line two<br style=\"a\" />end",
"expected": "line one\nline two\nend"
},
{
"input": "<p class=\"intro\">first</p><p style=\"margin:0\">second</p>",
"expected": "first\nsecond\n"
},
{
"input": "<!--[if mso]><style type=\"text/css\">td{}</style><![endif]--><style type=\"text/css\">@media{.a{b:c}}</style><table role=\"presentation\"><tr><td style=\"padding:0\">Sale &amp; more</td></tr></table>",
"expected": "Sale & more\n"
},
{
"input": "<p>Before</p><!----><p>Hello world</p>",
"expected": "Before\nHello world\n"
},
{
"input": "a<!-- x --->b<!---->c<!-->d<!--->e<!-- y --!>f",
"expected": "abcdef"
},
{
"input": "a<!---!>x--><!--!>y--><!-- z- ->w -->b",
"expected": "ab"
},
{
"input": "before<!-- unterminated --",
"expected": "before"
},
{
"input": "<b>Hello</b> world",
"expected": "Hello world"
},
{
"input": "<a href=u>link</a> text",
"expected": "link text"
},
{
"input": "<p>Name: <b>John</b> Smith</p>",
"expected": "Name: John Smith\n"
},
{
"input": "<p>a</p>\n<p>b</p>",
"expected": "a\nb\n"
},
{
"input": "<img alt=\"a > b\"> after",
"expected": "after"
},
{
"input": "<a title='1>0'>t</a>",
"expected": "t"
},
{
"input": "<img alt=\"a < b\" src=x>after",
"expected": "after"
},
{
"input": "<a href = \"x>y\" class=c>t</a> u",
"expected": "t u"
},
{
"input": "a<img alt=\"x>y",
"expected": "a"
},
{
"input": "<div>One</div><div>Two</div>",
"expected": "One\nTwo\n"
},
{
"input": "<ul><li>One</li><li>Two</li></ul>",
"expected": "One\nTwo\n"
},
{
"input": "<table><tr><td>One</td><td>Two</td></tr><tr><td>Three</td></tr></table>",
"expected": "One Two\nThree\n"
},
{
"input": "<h1>Title</h1><p>Body</p>",
"expected": "Title\nBody\n"
},
{
"input": "Intro<DIV class=\"a\"><Div>nested</div>tail</DIV>end",
"expected": "Intro\nnested\ntail\nend"
},
{
"input": "<p>a</p><p></p><hr><p>b<br></p>",
"expected": "a\nb\n"
},
{
"input": "<table>\n <tr>\n <th>Item</th>\n <th>Price</th>\n </tr>\n</table>",
"expected": "Item Price\n"
},
{
"input": "Hello<template><div>a</div><br><td>b</td></template> <style>p{}</style>World<script>\"<br>\"</script>!",
"expected": "Hello World!"
}
]