mirror of
https://github.com/miniflux/v2.git
synced 2025-08-16 18:01:37 +00:00
Do not convert anchors to absolute links
This commit is contained in:
parent
183cb491b3
commit
138fd926ee
2 changed files with 37 additions and 17 deletions
|
@ -203,6 +203,16 @@ func TestIFrameWithChildElements(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestAnchorLink(t *testing.T) {
|
||||
input := `<p>This link is <a href="#some-anchor">an anchor</a></p>`
|
||||
expected := `<p>This link is <a href="#some-anchor">an anchor</a></p>`
|
||||
output := Sanitize("http://example.org/", input)
|
||||
|
||||
if expected != output {
|
||||
t.Errorf(`Wrong output: "%s" != "%s"`, expected, output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInvalidURLScheme(t *testing.T) {
|
||||
input := `<p>This link is <a src="file:///etc/passwd">not valid</a></p>`
|
||||
expected := `<p>This link is not valid</p>`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue