intesso/connect-livereload

the rules has a problem

peigong opened this issue · 4 comments

/<\!DOCTYPE.+?>/i in the rules, what?
Sometimes, the rule can be a problem. Other rules is not enough?

Sometimes, the /<\!DOCTYPE.+>/i rule match <!DOCTYPE html><html><head>... ...</head><body>... ...<script id="tmpl-nav" type="text/x-dot-template"><div class="master-container">.

Example:

<!DOCTYPE html><html><head><meta charset="utf8">... ...</head><body><div class="top-banner">... ... </div><div id="nav-container"></div><div id="post-container"></div><div id="posts-container"></div><script id="tmpl-nav" type="text/x-dot-template"><div class="master-container">
<script>//<![CDATA[
document.write('<script src="//' + (location.hostname || 'localhost') + ':35729/livereload.js?snipver=1"><\/script>')
//]]></script>

    <ul class="nav">
        <li>[</li>
        {{~ it:item:idx }}
        {{? idx }}
        <li>,</li>
        {{?}}
        <li><a href="#/{{= item.name }}" data-id="{{= item.name }}">{ {{= item.title }} }</a></li>
        {{~}}
        <li>]</li>
    </ul>
</div>

<!DOCTYPE html> is needed, since this is a valid html page. did you close the body element: </body> ?

Perhaps the file is too long(>109K), the response write chunk by chunk, the first chunk does not contain </body> or </html>.
I use /<\!DOCTYPE.+?>/i, snippet append to the <!DOCTYPE html>. What do you think?

Sorry, sorry. I use 0.4.0.