shithub: hugo

Download patch

ref: 4b430d456afee9c6da5e5ab46084a05469be1430
parent: b9f10c75cb74c1976fbbf3d9e8dcdd4f3d46e790
author: Ralph Slooten <axllent@gmail.com>
date: Wed Sep 9 16:25:31 EDT 2020

Encode & in livereload injected code

--- a/transform/livereloadinject/livereloadinject.go
+++ b/transform/livereloadinject/livereloadinject.go
@@ -59,7 +59,7 @@
 			return err
 		}
 
-		script := []byte(fmt.Sprintf(`<script src="/livereload.js?port=%d&mindelay=10&v=2" data-no-instant defer></script>`, port))
+		script := []byte(fmt.Sprintf(`<script src="/livereload.js?port=%d&amp;mindelay=10&amp;v=2" data-no-instant defer></script>`, port))
 
 		i := idx
 		if match.appendScript {
--- a/transform/livereloadinject/livereloadinject_test.go
+++ b/transform/livereloadinject/livereloadinject_test.go
@@ -25,7 +25,7 @@
 func TestLiveReloadInject(t *testing.T) {
 	c := qt.New(t)
 
-	expectBase := `<script src="/livereload.js?port=1313&mindelay=10&v=2" data-no-instant defer></script>`
+	expectBase := `<script src="/livereload.js?port=1313&amp;mindelay=10&amp;v=2" data-no-instant defer></script>`
 	apply := func(s string) string {
 		out := new(bytes.Buffer)
 		in := strings.NewReader(s)