htmlhint / HTMLHint

⚙️ The static code analysis tool you need for your HTML
https://htmlhint.com
MIT License
3.09k stars 382 forks source link

Inline rules only work in the first line of a file #210

Closed lukaw3d closed 4 years ago

lukaw3d commented 7 years ago

Inline rules don't work unless they appear on the first line of a file.

I think it might just be that this regex needs a multiline flag https://github.com/yaniswang/HTMLHint/blob/master/src/core.js#L40

- html = html.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i, function(all, strRuleset){
+ html = html.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/im, function(all, strRuleset){
krank commented 6 years ago

Would be a very nice change, as it would allow specific blocks to be excluded or included from being checked against specific rules. Like php blocks for instance...

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.