intesso / connect-livereload

connect middleware for adding the livereload script to the response
MIT License
305 stars 53 forks source link

<pre> trap for snippet #47

Closed pepelsbey closed 9 years ago

pepelsbey commented 10 years ago

For some reason live reload script snippet is appearing inside <pre> element if you have &lt; plus \n there and don’t have optional <body> element. I would expect it to appear right after <p>bar</p> instead. This document is completely valid:

<!DOCTYPE html>
<title>Title</title>
<p>foo</p>
<pre>&lt;
</pre>
<p>bar</p>

It wouldn’t be a problem if it wasn’t <pre> element: I’m getting an extra line inside it because of misplaced snippet.

screen shot 2014-09-21 at 18 04 49

I’m using v0.4.0 as part of grunt-contrib-connect v0.8.0.

HiroAgustin commented 10 years ago

This is solved by PR #50, currently on v0.5.0. grunt-contrib-connect will apply this update on v0.9.0.