2023-06-19 23:42:47 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-20 06:10:04 +01:00
|
|
|
|
2023-08-11 04:46:45 +02:00
|
|
|
package sanitizer // import "miniflux.app/v2/internal/reader/sanitizer"
|
2017-11-20 06:10:04 +01:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|