mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
add_mailto_subject: New rewrite function
Dinosaur Comics (qwantz.com) likes to hide jokes in mailto: links, but miniflux's sanitizer strips those out.
This commit is contained in:
parent
77125f45cc
commit
b6f3160dbc
4 changed files with 45 additions and 0 deletions
|
@ -98,6 +98,15 @@ func TestRewriteWithXkcdAndNoImage(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestRewriteMailtoLink(t *testing.T) {
|
||||
description := `<a href="mailto:ryan@qwantz.com?subject=blah%20blah">contact</a>`
|
||||
output := Rewriter("https://www.qwantz.com/", description, ``)
|
||||
expected := `<a href="mailto:ryan@qwantz.com?subject=blah%20blah">contact [blah blah]</a>`
|
||||
if expected != output {
|
||||
t.Errorf(`Not expected output: got "%s" instead of "%s"`, output, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRewriteWithPDFLink(t *testing.T) {
|
||||
description := "test"
|
||||
output := Rewriter("https://example.org/document.pdf", description, ``)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue