mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	Encode & in livereload injected code
This commit is contained in:
		
				
					committed by
					
						
						Bjørn Erik Pedersen
					
				
			
			
				
	
			
			
			
						parent
						
							b9f10c75cb
						
					
				
				
					commit
					4b430d456a
				
			@@ -59,7 +59,7 @@ func New(port int) transform.Transformer {
 | 
				
			|||||||
			return err
 | 
								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&mindelay=10&v=2" data-no-instant defer></script>`, port))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		i := idx
 | 
							i := idx
 | 
				
			||||||
		if match.appendScript {
 | 
							if match.appendScript {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,7 +25,7 @@ import (
 | 
				
			|||||||
func TestLiveReloadInject(t *testing.T) {
 | 
					func TestLiveReloadInject(t *testing.T) {
 | 
				
			||||||
	c := qt.New(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&mindelay=10&v=2" data-no-instant defer></script>`
 | 
				
			||||||
	apply := func(s string) string {
 | 
						apply := func(s string) string {
 | 
				
			||||||
		out := new(bytes.Buffer)
 | 
							out := new(bytes.Buffer)
 | 
				
			||||||
		in := strings.NewReader(s)
 | 
							in := strings.NewReader(s)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user