negibouze / html-webpack-pug-plugin

Pug/Jade extension for the HTML Webpack Plugin
MIT License
29 stars 7 forks source link

Broken indentation with each expression #23

Closed NGPixel closed 5 years ago

NGPixel commented 5 years ago

Using html-webpack-pug-plugin version 1.0.1, the indentation below each expressions is lost in the transformed result, e.g.:

html
  head
    each favsize in [57, 60, 72, 76, 114, 120, 144, 152, 180]
      link(rel='apple-touch-icon', sizes=favsize + 'x' + favsize, href='/favicons/apple-icon-' + favsize + 'x' + favsize + '.png')
    link(rel='icon', type='image/png', sizes='192x192', href='/favicons/android-icon-192x192.png')
    each favsize in [32, 96, 16]
      link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png')
    link(rel='manifest', href='/manifest.json')

is incorrectly transformed to

html
  head
    each favsize in [57, 60, 72, 76, 114, 120, 144, 152, 180]
    link(rel='apple-touch-icon', sizes=favsize + 'x' + favsize, href='/favicons/apple-icon-' + favsize + 'x' + favsize + '.png')
    link(rel='icon', type='image/png', sizes='192x192', href='/favicons/android-icon-192x192.png')
    each favsize in [32, 96, 16]
    link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png')
    link(rel='manifest', href='/manifest.json')

The indentation should be retained in the final result.

Thanks!

negibouze commented 5 years ago

@NGPixel Thank you for your report.

negibouze commented 5 years ago

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

NGPixel commented 5 years ago

👍 Thanks that works