bukalapak / snowboard

API blueprint toolkit
MIT License
781 stars 115 forks source link

Console error: Uncaught SyntaxError: Unexpected end of input #131

Open ls-dac-chartrand opened 4 years ago

ls-dac-chartrand commented 4 years ago

When I try to use Snowboard 3.7.5 to generate an html page it doesn't work. Chrome complains about Uncaught SyntaxError: Unexpected end of input.

Can't use Snowboard 4.x+ because it doesn't has the ability to generate a single webpage.

Steps to reproduce

On MacOS 10.15.4

Download: https://github.com/apiaryio/api-blueprint/blob/master/examples/01.%20Simplest%20API.md

yarn add global snowboard@3.7.5
snowboard html -o test.html 01.\ Simplest\ API.md.txt
open test.html

Expected: Webpage

Actual: Console error: Uncaught SyntaxError: Unexpected end of input

Screen Shot 2020-05-25 at 10 03 43 AM

Workaround

I think the. problem comes from here: https://github.com/sveltejs/svelte/pull/2989/files#diff-88efceaaf9db61e49b0b84e7a104679bR276

I can fix by opening test.html and changing:

iframe.src = `data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>`;

To

iframe.src = "data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>"
ls-chloe-schoreisz commented 4 years ago

👍