From 08b582e18730d44111203e28e761c5c7c07062bf Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Sat, 6 Feb 2016 19:22:12 +0100 Subject: Only do one livereload replacement --- transform/livereloadinject.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'transform') diff --git a/transform/livereloadinject.go b/transform/livereloadinject.go index 9eab45f78..bd22901df 100644 --- a/transform/livereloadinject.go +++ b/transform/livereloadinject.go @@ -24,12 +24,12 @@ func LiveReloadInject(ct contentTransformer) { replaceTemplate := `%s` replace := []byte(fmt.Sprintf(replaceTemplate, endBodyTag)) - newcontent := bytes.Replace(ct.Content(), match, replace, -1) + newcontent := bytes.Replace(ct.Content(), match, replace, 1) if len(newcontent) == len(ct.Content()) { endBodyTag = "" replace := []byte(fmt.Sprintf(replaceTemplate, endBodyTag)) match := []byte(endBodyTag) - newcontent = bytes.Replace(ct.Content(), match, replace, -1) + newcontent = bytes.Replace(ct.Content(), match, replace, 1) } ct.Write(newcontent) -- cgit v1.2.3