10

I'm using tidy-html5 from brew, and i can't tidy up my angular templates because they use custom elements like those :

<due-diligence-point index="1" title="Lead Screening">

This throws this error on tidy-html5 :

line 26 column 9 - Error: <due-diligence-point> is not recognized!

There is an option i'm skipping or this will just not work with tidy ?

The only option i have is to populate manually "new-empty-tags" ?

Eduardo Moniz
  • 2,095
  • 3
  • 18
  • 27

2 Answers2

0

Little late to the party of one here but have you tried prefixing your element with the 'data-' tag? The following succeeds an HTML5 validator.

<!DOCTYPE html>
<html>
<head><title>asdf</title></head>
<data-custom-tag></data-custom-tag>
</html>

If you remove the data prefix however it will throw an error as an unrecognized element.

Smeghead Sev
  • 418
  • 4
  • 14
  • even if it would have worked that should not be the approach, idea is to make tidy work for angular not to change angular code altogether. – ishandutta2007 Apr 13 '19 at 04:34
-1

I've asked this before prettier existed, which completelly solves this kind of problem.

Eduardo Moniz
  • 2,095
  • 3
  • 18
  • 27