Skip to content

Commit

Permalink
Improve logging for meta refresh quote error
Browse files Browse the repository at this point in the history
Will fix #137
  • Loading branch information
wjdp committed Jan 16, 2021
1 parent bbdd205 commit 32ed5f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions htmltest/check-meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ func (hT *HTMLTest) checkMetaRefresh(document *htmldoc.Document, node *html.Node
if len(contentSplit) == 2 {
if contentSplit[1][0] == 34 || contentSplit[1][0] == 39 {
hT.issueStore.AddIssue(issues.Issue{
Level: issues.LevelError,
Message: "url in meta refresh must not start with single or double quote",
Reference: ref,
Level: issues.LevelError,
Message: "url in meta refresh must not start with single or double quote",
Document: document,
})
return
}

ref, err = htmldoc.NewReference(document, node, contentSplit[1])
} else {
ref, err = htmldoc.NewReference(document, node, "")
Expand Down
2 changes: 1 addition & 1 deletion htmltest/check-meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ func TestMetaRefreshContentInvalid(t *testing.T) {
func TestIssue92(t *testing.T) {
hT := tTestFile("fixtures/meta/issues/92.html")
tExpectIssueCount(t, hT, 2)
tExpectIssue(t, hT, "url in meta refresh must not start with single or double quote", 2)
tExpectIssue(t, hT, "url in meta refresh must not start with single or double quote", 3)
}

0 comments on commit 32ed5f8

Please sign in to comment.