mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
Return unmodified content if panic in LiveReloadInject
This commit is contained in:
1 parent
4d708f096d
commit
62752cfee9
1 file changed
+2
-1
@@ -6,10 +6,11 @@ import (
|
|||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
func LiveReloadInject(content []byte) []byte {
|
func LiveReloadInject(content []byte) (injected []byte) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
jww.ERROR.Println("Recovered in LiveReloadInject", r)
|
jww.ERROR.Println("Recovered in LiveReloadInject", r)
|
||||||
|
injected = content
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
match := []byte("</body>")
|
match := []byte("</body>")
|
||||||
|
|||||||
Reference in new issue
Block a user