Open deining opened 1 year ago
I have similar, tho in my case I cannot decode where the problem is:. <a href=:
doesn't appear in my output.
panic: CreateFile public/apps/<a href=: The filename, directory name, or volume label syntax is incorrect.
goroutine 1 [running]:
github.com/wjdp/htmltest/output.CheckErrorPanic(...)
/home/runner/work/htmltest/htmltest/output/error.go:22
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkFile(0xc00022ec80, 0xc000a536e0, {0xc0002c9518, 0x14})
/home/runner/work/htmltest/htmltest/htmltest/check-link.go:366 +0x298
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkInternal(0xc00022ec80, 0xc000a536e0)
/home/runner/work/htmltest/htmltest/htmltest/check-link.go:306 +0x159
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkLink(0xc00022ec80, 0xc0002227e0, 0xc0010d9f80)
/home/runner/work/htmltest/htmltest/htmltest/check-link.go:99 +0x1028
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocument(0xc00022ec80, 0xc0002227e0)
/home/runner/work/htmltest/htmltest/htmltest/htmltest.go:213 +0x205
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocuments(0xc00022ec80)
/home/runner/work/htmltest/htmltest/htmltest/htmltest.go:184 +0x22f
github.com/wjdp/htmltest/htmltest.Test(0xce2680)
/home/runner/work/htmltest/htmltest/htmltest/htmltest.go:144 +0x911
main.run(0xc30fa0)
/home/runner/work/htmltest/htmltest/main.go:163 +0x195
main.main()
/home/runner/work/htmltest/htmltest/main.go:71 +0x1e5
How to repoduce
Create
index.html
with this content in an empty directory of your choice:Please note the
<a>
element at line 6 with the link target{{< relref "/docs" >}}
. The latter is a built in hugo shortcode.Run htmltest inside this directory:
However, exiting with a panic is never a good thing.
htmltest
could/should handle this issue more gracefully and continue with link checking IMHO.Note: Of course I am aware of the fact that the file does not held valid html, so I consider this is a minor issue.