Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent failure if the view starts with a space or newline #27

Closed
chancyk opened this issue Jul 9, 2018 · 3 comments
Closed

Silent failure if the view starts with a space or newline #27

chancyk opened this issue Jul 9, 2018 · 3 comments

Comments

@chancyk
Copy link

chancyk commented Jul 9, 2018

AppRun seems to silently produce nothing if there's a space or newline before the first element in the view. I noticed this initially when using the backtick string form, e.g.:

return `
<div>
  <div>hello</div>
  <div>world</div>
</div
`

The code below produces the issue for me on AppRun version 1.13.8 and Chrome 67:

<html>
<head>
    <script src="https://unpkg.com/apprun@1.13.8/dist/apprun-html.js"></script>
</head>

<body>
    <div id="app-content">
    </div>

    <script>
        const state = {};
        const view = state => {
            return ' <div>hello</div>';
        };

        const update = {
        };
        app.start('app-content', state, view, update);
    </script>
</body>
</html>
@yysun
Copy link
Owner

yysun commented Jul 9, 2018

Confirmed. I will release a fix tonight.

@yysun
Copy link
Owner

yysun commented Jul 10, 2018

It has been fixed in 1.13.9

@chancyk
Copy link
Author

chancyk commented Jul 10, 2018

Confirmed fixed. Thanks!

@chancyk chancyk closed this as completed Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants