aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorRalph Slooten <[email protected]>2020-09-09 20:25:31 +1200
committerBjørn Erik Pedersen <[email protected]>2020-09-09 22:09:40 +0200
commit4b430d456afee9c6da5e5ab46084a05469be1430 (patch)
treeffbe9fd63eedf6a5b6944f91ca0f4a38819bf9dc /transform
parentb9f10c75cb74c1976fbbf3d9e8dcdd4f3d46e790 (diff)
downloadhugo-4b430d456afee9c6da5e5ab46084a05469be1430.tar.gz
hugo-4b430d456afee9c6da5e5ab46084a05469be1430.zip
Encode & in livereload injected code
Diffstat (limited to 'transform')
-rw-r--r--transform/livereloadinject/livereloadinject.go2
-rw-r--r--transform/livereloadinject/livereloadinject_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/transform/livereloadinject/livereloadinject.go b/transform/livereloadinject/livereloadinject.go
index bbafdff72..a6e56ac41 100644
--- a/transform/livereloadinject/livereloadinject.go
+++ b/transform/livereloadinject/livereloadinject.go
@@ -59,7 +59,7 @@ func New(port int) transform.Transformer {
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 {
diff --git a/transform/livereloadinject/livereloadinject_test.go b/transform/livereloadinject/livereloadinject_test.go
index 690db31c2..59124f20b 100644
--- a/transform/livereloadinject/livereloadinject_test.go
+++ b/transform/livereloadinject/livereloadinject_test.go
@@ -25,7 +25,7 @@ import (
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)