Skip to content

Commit

Permalink
minor improve
Browse files Browse the repository at this point in the history
  • Loading branch information
SYM01 committed Dec 13, 2023
1 parent bb40556 commit a2afdf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
4 changes: 2 additions & 2 deletions dfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (w *writer) sNORMAL() (err error) {
}

_, err = w.flush()
return err
return
}

func (w *writer) sNONHTML() (err error) {
Expand All @@ -242,7 +242,7 @@ func (w *writer) sNONHTML() (err error) {
}

_, err = w.flush()
return err
return
}

func (w *writer) sLTSIGN() error {
Expand Down
18 changes: 0 additions & 18 deletions sanitizer_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,3 @@ func FuzzSanitize(f *testing.F) {
}
})
}

func TestSanitize_tmp(t *testing.T) {
a := []byte(`</A>`)
data := append([]byte(`abc<script>`), a...)
data = append(data, `abc</script>def<style>`...)
data = append(data, a...)
data = append(data, `</style ...>(g)`...)
expected := []byte(`abcdef(g)`)
ret, err := htmlsanitizer.Sanitize(data)
if err != nil {
t.Errorf("unable to Sanitize err: %s", err)
return
}
if !bytes.Equal(ret, expected) {
t.Errorf("test failed for %s, expect %s, got %s", data, expected, ret)
return
}
}

0 comments on commit a2afdf9

Please sign in to comment.