Skip to content

Commit

Permalink
Encode & in livereload injected code
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent authored and bep committed Sep 9, 2020
1 parent b9f10c7 commit 4b430d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion transform/livereloadinject/livereloadinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion transform/livereloadinject/livereloadinject_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4b430d4

Please sign in to comment.