html2jade icon indicating copy to clipboard operation
html2jade copied to clipboard

Don't work with Angular 2 template syntax

Open desaroger opened this issue 8 years ago • 6 comments

Angular 2 makes use of case-sensitive attributes.

For this test I have this html:

<nav>
      <span>
        <a [routerLink]=" ['./'] ">
          Index
        </a>
      </span>
</nav>

If I run:

$ html2hade test.html --bodyless

I get:

nav
  span
    a([routerlink]=" ['./'] ")
      | Index

As you can see, now the attribute routerLink is in lowercase, routerlink, and doesn't work anymore with Angular.

I tried with -s and --donotencode, same results.

desaroger avatar Dec 14 '16 12:12 desaroger

This is related to #102 and share root cause: DOM parser used (jsdom) either did not or does not preserve case.

donpark avatar Dec 15 '16 10:12 donpark

Hi @donpark, oh I see jsdom-little isn't updated from 2 years :/

Do you have any plan to solve this? Changing the DOM parser or something like this? Oh and sorry for duplicate issues, I made a search but didn't found that one.

desaroger avatar Dec 21 '16 07:12 desaroger

@desaroger well, this issue calls for a major change which will very likely disturb existing users so I think it's best to fork.

@aichholzer any plan to address this issue?

donpark avatar Dec 21 '16 11:12 donpark

@desaroger a complete re-write is on the way. I will revisit this issue when I get there. Thank you for reporting it.

aichholzer avatar Feb 16 '17 05:02 aichholzer

@aichholzer Thanks, happy to see a resolution for this issue as I use html2jade all the time, and just now getting into Angular2 with case-sensitive dom elements. Thanks!

rmckeel avatar Apr 26 '17 20:04 rmckeel

Same with ngModel

rsxdalv avatar May 24 '17 12:05 rsxdalv