1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Basic table removal rule

This commit is contained in:
Jake Walker 2023-03-31 19:23:31 +01:00 committed by Frédéric Guillot
parent 9a826bbe6f
commit 49d2596fc6
3 changed files with 43 additions and 0 deletions

View file

@ -325,3 +325,13 @@ func TestRewriteBase64DecodeArgs(t *testing.T) {
t.Errorf(`Not expected output: got "%s" instead of "%s"`, output, expected)
}
}
func TestRewriteRemoveTables(t *testing.T) {
content := `<table class="container"><tbody><tr><td><p>Test</p><table class="row"><tbody><tr><td>Hello World!</td></tr></tbody></table></td></tr></tbody></table>`
expected := `<p>Test</p>Hello World!`
output := Rewriter("https://example.org/article", content, `remove_tables`)
if expected != output {
t.Errorf(`Not expected output: got "%s" instead of "%s"`, output, expected)
}
}