aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader/sanitizer/strip_tags_test.go
blob: 18a0ce820606728082130adaf11e04deeeff215a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

package sanitizer // import "miniflux.app/reader/sanitizer"

import "testing"

func TestStripTags(t *testing.T) {
	input := `This <a href="/test.html">link is relative</a> and <strong>this</strong> image: <img src="../folder/image.png"/>`
	expected := `This link is relative and this image: `
	output := StripTags(input)

	if expected != output {
		t.Errorf(`Wrong output: "%s" != "%s"`, expected, output)
	}
}