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

Line after head is not indented #20

Closed
jeremytowne opened this issue May 9, 2019 · 7 comments
Closed

Line after head is not indented #20

jeremytowne opened this issue May 9, 2019 · 7 comments

Comments

@jeremytowne
Copy link

The line after the head seems to not be indented properly. The rest of the file seems to be indented properly, but the line after head is not indented at all.

Ex:
template.pug:

doctype html
html(lang='en')
  head
    title
      block pageTitle

output:

doctype html
html(lang='en')
  head
title
      block pageTitle
@negibouze
Copy link
Owner

@jeremytowne
Thank you for your report.

@negibouze
Copy link
Owner

@jeremytowne
It is a temporary workaround.
Try putting meta above title.
like this:

doctype html
html(lang='en')
  head
    meta(charset="utf-8")
    title
      block pageTitle
  body

@jeremytowne
Copy link
Author

@negibouze thank you for the quick response! I think the fix is to change the regex to:
var regExp = /^(([ |\t]*)html.*\n)(([ |\t]*)head\n)([ |\t]*[\s\S]*)(\n[ |\t]*body)/im;

@jeremytowne
Copy link
Author

Also, it seems like your workaround is working for me in the meantime.

@negibouze
Copy link
Owner

@jeremytowne
I released a new version(v1.0.1).
Thank you for your cooperation :)

@jeremytowne
Copy link
Author

Thank you @negibouze!

@jeremytowne
Copy link
Author

1.0.1 is working without the meta workaround, closing :)

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