html2pug icon indicating copy to clipboard operation
html2pug copied to clipboard

Case of dom element attributes is dropped, unnecessary end of line period

Open rmckeel opened this issue 5 years ago • 0 comments

In the following example, *ngFor attribute is converted into *ngfor attribute in pug. I believe this is a mistake to force lowercase on conversion, and results in non-functional Angular code in this case.

INPUT:
echo "<div class="products" *ngFor="let product of products"/>" | html2pug -d -f

OUTPUT:
.products(*ngfor="let" product of products).

Additionally, the end dot is unnecessary as there is no further text.

Side note: I'd love to see "smarter" processing of when to use a dot at the end of the line. In practice, I use a dot at the end of the line seldomly, preferring the next line starting with pipe as it is typically only one line. Perhaps a pipe could be used when it is only one line, and a dot when it is multiple lines?

Thanks for your work on this!

rmckeel avatar Aug 19 '20 21:08 rmckeel