CSS selector operation now works in a web worker. Fixes #218

This commit is contained in:
n1474335 2017-12-20 13:30:51 +00:00
parent ecd0ac2521
commit 317327d097
4 changed files with 1567 additions and 623 deletions

View file

@ -310,4 +310,26 @@ TestRegister.addTests([
}
],
},
{
name: "CSS selector",
input: '<div id="test">\n<p class="a">hello</p>\n<p>world</p>\n<p class="a">again</p>\n</div>',
expectedOutput: '<p class="a">hello</p>\n<p class="a">again</p>',
recipeConfig: [
{
"op": "CSS selector",
"args": ["#test p.a", "\\n"]
}
]
},
{
name: "XPath expression",
input: '<div id="test">\n<p class="a">hello</p>\n<p>world</p>\n<p class="a">again</p>\n</div>',
expectedOutput: '<p class="a">hello</p>\n<p class="a">again</p>',
recipeConfig: [
{
"op": "XPath expression",
"args": ["/div/p[@class=\"a\"]", "\\n"]
}
]
}
]);