praveenvijayan / grunt-html-validation

W3C html validaton grunt plugin. Validate all files in a directory automatically.
MIT License
75 stars 39 forks source link

Ignore php blocks #60

Open senor-developer opened 10 years ago

senor-developer commented 10 years ago

Is there any way to tell the validator to skip over php tags? The project I'm currently working on relies heavily on php includes for factorization, but the files are otherwise 99% html. The validator runs flawless on php files, I just need it to ignore whatever is between <?php and ?>

Any ideas?

BOOMER74 commented 10 years ago

Ignore is not good idea. Need to try execute php and validate output html.

senor-developer commented 10 years ago

Thanks for the suggestion, I got it to work using grunt-php2html to parse all php files into my .tmp folder and run htmlhint in there. The only drawback is that (obviously) line numbers are off as the line numbers in my IDE no longer match the parsed html files in .tmp.

Can't think of any workaround right now, but any further suggestions would be much appreciated :)

paulbhartzog commented 9 years ago

Yes, is there a way to do html validation with grunt on php files other than php2html?