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

style is not indented properly if applying style on the body #22

Open
jeremytowne opened this issue May 9, 2019 · 2 comments
Open

style is not indented properly if applying style on the body #22

jeremytowne opened this issue May 9, 2019 · 2 comments

Comments

@jeremytowne
Copy link

this template:

block header
  style.
    body {
      margin: 0;
    }

will generate like (2 extra spaces before style):

block header
    style.
    body {
      margin: 0;
    }

a workaround I've found is to add some selector before body in the template, like:

block header
  style.
    #some-unused-selector, body {
      margin: 0;
    }
@negibouze
Copy link
Owner

@jeremytowne
Thank you for your report.

@negibouze
Copy link
Owner

@jeremytowne
Sorry for my late reply.
I released a new version(v2.0.0).
Please try it.

In your case, you need to set ast true (see below).

  plugins: [
    new HtmlWebpackPlugin({
      template: 'template.pug',
      filename: 'index.pug'
    }),
    new HtmlWebpackPugPlugin({
      ast: true
    })
  ]

However, it may not work well because pug-source-gen is not maintained.

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