Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

space-tab-mix-disabled #119

Closed
dawidk92 opened this issue Mar 30, 2016 · 3 comments
Closed

space-tab-mix-disabled #119

dawidk92 opened this issue Mar 30, 2016 · 3 comments

Comments

@dawidk92
Copy link

"space-tab-mixed-disabled": "tab"

I have space after <span> inside <p> and htmlhint throws it as an warning. It's really annoying issue

image

@shaochuancs
Copy link

Currently, "space-tab-mixed-disabled" rule in HTMLHint checks space/tab inside each DOM node, that's why the space after span tag will result in warning, when this rule value is "tab".

It seems this rule would be more reasonable if it only checks space/tab at the beginning of each line to alert bad indentation styles, and leave space/tab inside DOM element alone.

Need @yaniswang to confirm this behaviour change. I tried to fix this issue by fire new event when line break is found, but this may violate some current design.

@molant
Copy link
Contributor

molant commented Apr 15, 2016

In my case I'm solving this changing line 19 of space-tab-mixed-disabled.js with this:

else if (options === 'tab' && /^\t+$/.test(match[2]) === false && match.input.indexOf('\n') !== -1) {

If there isn't a new line in the original string that I'm matching, then I ignore the error

molant added a commit to molant/HTMLHint that referenced this issue Apr 15, 2016
molant added a commit to molant/HTMLHint that referenced this issue Apr 15, 2016
@shaochuancs
Copy link

@molant, this is a quick fix and it solves the problem. However, the performance can be improved as space-tab-mixed-disabled rule does not need to be invoked if there is no line break.

I'll submit a pull request later, fixing this issue by fire&listen line-break event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants