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

Marko with javascript inline is not formatted properly #192

Open
okannivadikubendran opened this issue Jul 26, 2021 · 0 comments
Open

Marko with javascript inline is not formatted properly #192

okannivadikubendran opened this issue Jul 26, 2021 · 0 comments

Comments

@okannivadikubendran
Copy link

Using @marko/prettyprint - 3.0.1 with the command marko-prettyprint . --single-quote --max-len 120, we are seeing following issues:

  1. First line in the script block is not indented similar to the other lines
  2. Shorthand notation is not working for the marko attributes in the options of sample-header

Given:

$ const { model, options } = input;
<if(model)>
    $ {
        const {foo} = model;
        const {bar} = foo || {};
        const {xyz} = options || {};
    }
    <div class="app"> <sample-header options={ xyz } />    </div>
</if>

Expected:

$ const { model, options } = input;
<if(model)>
    $ {
        const { foo } = model;
        const { bar } = foo || {};
        const { xyz } = options || {};
    }
    <div class='app'>
        <sample-header options={ xyz }/>
    </div>
</if>

Actual:

$ const { model, options } = input;
<if(model)>
    $ {
        const { foo } = model;
            const { bar } = foo || {};
            const { xyz } = options || {};
    }
    <div class='app'>
        <sample-header options={
            xyz: xyz
        }/>
    </div>
</if>

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

1 participant