New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional parsing for scripts #1093
Changes from 3 commits
d651c4f
4c0c2e3
c7ed72a
4e0161b
238b5b5
3466add
8bbe8e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,18 @@ let ``Can handle attributes with no value``() = | |
] | ||
node.Attributes() |> should equal expected | ||
|
||
[<TestCase("var r =\"</script>\"")>] | ||
[<TestCase("var r ='</script>'")>] | ||
[<TestCase("var r =/</g")>] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a test case with |
||
[<TestCase("//</script>\n")>] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add the opposite case, not having the \n at the end to make sure it fails |
||
[<TestCase("/*</script>*/")>] | ||
[<TestCase("/*</script>**/")>] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add test cases that use |
||
let ``Can handle special characters in scripts`` content = | ||
let html = sprintf "<script>%s</script>" content | ||
let node = HtmlNode.Parse html |> List.head | ||
let expected = HtmlNode.NewElement("script", [ HtmlNode.NewText content ]) | ||
node |> should equal expected | ||
|
||
[<Test>] | ||
let ``Can parse tables from a simple html``() = | ||
let html = """<html> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: sinle instead of single