diff options
author | Peter De Wachter <pdewacht@gmail.com> | 2019-08-13 17:44:23 +0200 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2019-08-19 19:42:47 -0700 |
commit | b6f3160dbc3efe7a86d39d526a1780eb320eefd4 (patch) | |
tree | fc1148cd9a3de6611a9ca319a54b29c9a0f05cd0 /reader/rewrite/rewriter_test.go | |
parent | 77125f45ccebc1b9abc9aeef2a8576b6841c5768 (diff) |
add_mailto_subject: New rewrite function
Dinosaur Comics (qwantz.com) likes to hide jokes in mailto: links, but
miniflux's sanitizer strips those out.
Diffstat (limited to 'reader/rewrite/rewriter_test.go')
-rw-r--r-- | reader/rewrite/rewriter_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/reader/rewrite/rewriter_test.go b/reader/rewrite/rewriter_test.go index 9bd83e8..0fd49ba 100644 --- a/reader/rewrite/rewriter_test.go +++ b/reader/rewrite/rewriter_test.go @@ -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, ``) |