mirror of
https://github.com/miniflux/v2.git
synced 2025-07-22 17:18:37 +00:00
feat(sanitizer): validate MathML XML namespace
This commit is contained in:
parent
21d22d7f0b
commit
d53fd17e10
2 changed files with 14 additions and 0 deletions
|
@ -829,3 +829,13 @@ func TestMathML(t *testing.T) {
|
|||
t.Errorf(`Wrong output: "%s" != "%s"`, expected, output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInvalidMathMLXMLNamespace(t *testing.T) {
|
||||
input := `<math xmlns="http://example.org"><msup><mi>x</mi><mn>2</mn></msup></math>`
|
||||
expected := `<math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>x</mi><mn>2</mn></msup></math>`
|
||||
output := SanitizeHTMLWithDefaultOptions("http://example.org/", input)
|
||||
|
||||
if expected != output {
|
||||
t.Errorf(`Wrong output: "%s" != "%s"`, expected, output)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue