Răsfoiți Sursa

fix: allow the `<b>` tag

jvoisin 1 an în urmă
părinte
comite
f916373f55

+ 1 - 0
internal/reader/sanitizer/sanitizer.go

@@ -25,6 +25,7 @@ var (
 		"aside":      {},
 		"audio":      {"src"},
 		"blockquote": {},
+		"b":          {},
 		"br":         {},
 		"caption":    {},
 		"cite":       {},

+ 2 - 2
internal/reader/sanitizer/sanitizer_test.go

@@ -198,7 +198,7 @@ func TestProtocolRelativeURL(t *testing.T) {
 }
 
 func TestInvalidTag(t *testing.T) {
-	input := `<p>My invalid <b>tag</b>.</p>`
+	input := `<p>My invalid <z>tag</z>.</p>`
 	expected := `<p>My invalid tag.</p>`
 	output := Sanitize("http://example.org/", input)
 
@@ -238,7 +238,7 @@ func TestUnknownTag(t *testing.T) {
 }
 
 func TestInvalidNestedTag(t *testing.T) {
-	input := `<p>My invalid <b>tag with some <em>valid</em> tag</b>.</p>`
+	input := `<p>My invalid <z>tag with some <em>valid</em> tag</z>.</p>`
 	expected := `<p>My invalid tag with some <em>valid</em> tag.</p>`
 	output := Sanitize("http://example.org/", input)