benurb / html-loader-escape-bug

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interpolate incorrect quotes test case

Execute npm i && npm run build and look at the two generated html files.

Expected result for both files (look at the quotes inside the script tags):

<!DOCTYPE html>
<html>
    <head>
        <meta name="description" content="This page contains schema.org information">
        <script type="application/ld+json">
            {
                "name": "This is a \"cool\" webpage",
                "key": "bla 'blub' bla"
            }
        </script>
        <script>
            var str = 'This is the \'best\' string';
        </script>
    </head>
    <body></body>
</html>

But the result for ?interpolate is:

<!DOCTYPE html>
<html>
    <head>
        <meta name="description" content="This page contains schema.org information">
        <script type="application/ld+json">
            {
                "name": "This is a "cool" webpage",
                "key": "bla 'blub' bla"
            }
        </script>
        <script>
            var str = 'This is the 'best' string';
        </script>
    </head>
    <body></body>
</html>

About


Languages

Language:HTML 50.8%Language:JavaScript 49.2%