Skip to content

Commit

Permalink
fix: allow the <b> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin committed Mar 6, 2025
1 parent 3b8ac8b commit a0682d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/reader/sanitizer/sanitizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
"aside": {},
"audio": {"src"},
"blockquote": {},
"b": {},
"br": {},
"caption": {},
"cite": {},
Expand Down
4 changes: 2 additions & 2 deletions internal/reader/sanitizer/sanitizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit a0682d1

Please sign in to comment.