madskristensen / WebEssentials2015

A Visual Studio extension for web developers
Other
300 stars 94 forks source link

Javascript in WE-Markdown.html - Input string was not in a correct format #160

Open kornelijepetak opened 8 years ago

kornelijepetak commented 8 years ago

I have changed the body element from the default template to this:

<body>
    <!-- This is where the rendered html from your document is placed -->
    {2}

    <script type="text/javascript">
        var div = document.querySelectorAll("div");
        for (var i = 0; i < div.length; i++) {
        }
    </script>

</body>

I get this:

Custom Html Template Error Input string was not in a correct format.

This is a valid javascript, correctly placed within the script tag. The same error is caused even if the script tag is placed within head. However, if I remove the for loop and leave only the first row of the javascript, the .md is parsed correctly.

Are there any documented limits on what can or can't be included in the WE-Markdown.html template?