-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
Description
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.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<a href="{{< relref "/docs" >}}">My link</a>
</body>
</html>
Run htmltest inside this directory:
$ htmltest .
htmltest started at 08:44:28 on .
========================================================================
panic: CreateFile {{< relref: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
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(0xc0000aa000, 0xc0000ae2d0, {0xc0000871b0, 0xa})
/home/runner/work/htmltest/htmltest/htmltest/check-link.go:366 +0x298
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkInternal(0xc0000aa000, 0xc0000ae2d0)
/home/runner/work/htmltest/htmltest/htmltest/check-link.go:306 +0x159
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkLink(0xc0000aa000, 0xc0000be090, 0xc0000ca7e0)
/home/runner/work/htmltest/htmltest/htmltest/check-link.go:99 +0x1028
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocument(0xc0000aa000, 0xc0000be090)
/home/runner/work/htmltest/htmltest/htmltest/htmltest.go:213 +0x205
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocuments(0xc0000aa000)
/home/runner/work/htmltest/htmltest/htmltest/htmltest.go:184 +0x22f
github.com/wjdp/htmltest/htmltest.Test(0x1132680)
/home/runner/work/htmltest/htmltest/htmltest/htmltest.go:144 +0x911
main.run(0x1080fa0)
/home/runner/work/htmltest/htmltest/main.go:163 +0x195
main.main()
/home/runner/work/htmltest/htmltest/main.go:71 +0x1e5
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.