Open esemlabel opened 5 years ago
- Current version of extension doesn't work when mixing code in PHP files.
The easiest and fastest solution would be ability to set custom regex via htmlhint options to exclude content from linting, so users could decide what to exclude by themselves, e.g.
"htmlhint.excludePattern": "/<\?(php|=)?(.+?)\?>/is",
or even multiple patterns
"htmlhint.excludePattern": [
"/somepattern1/",
"/somepattern2/"
],
Then everything except patterns match can be checked with linter. Or just wrap every matches in <!-- -->
comment tags.
+1 for this
Adding
php
todocumentSelector
option doesn't make much sense, since extension doesn't know how to ignore embeddedPHP
(<?php
,<?
,<?=
,?>
, heredoc opening<<<HTML
and closing\nHTML;
) tags inside php files when mixing with html code, which is usual for PHP coding. That's why errors, that doesn't related to html, appears for embedded tags every time linter is running with message Special characters must be escaped.Regex pattern for excluding php tags and its content should run before pass document to linter. It is very important for php coding.
I hope you will fix this as soon as possible to make every programmer much happier. Thank you very much!
Linter doesn't work for unsaved php files (and html too), when you just started typing or copy pasting code.
Linter doesn't start to check php file until any other html document is open. That's very annoying, especially when you aren't using html documents in projects at all.
OS: 10.11.6 (El Capitan). VS: 1.29.1