Skip to content

Instantly share code, notes, and snippets.

@r7kamura
Last active December 26, 2015 20:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r7kamura/bc1577d4410891ade243 to your computer and use it in GitHub Desktop.
Save r7kamura/bc1577d4410891ade243 to your computer and use it in GitHub Desktop.
// Imported from https://github.com/curtisj44/HTML-Lint
jQuery.each({
'a:empty, b:empty, abbr:empty, acronym:empty, button:empty, dd:empty, div:empty, dl:empty, dt:empty, h1:empty, h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, form:empty, fieldset:empty, label:empty, li:empty, ol:empty, p:empty, span:empty, strong:empty, ul:empty': {
'label': 'empty tag'
},
'applet': {
'label': '<code>&lt;applet&gt;</code>'
},
'center': {
'label': '<code>&lt;center&gt;</code>'
},
'font': {
'label': '<code>&lt;font&gt;</code>'
},
//'iframe': {
// 'label': '<code>&lt;iframe&gt;</code>'
//},
'noscript': {
'label': '<code>&lt;noscript&gt;</code>'
},
's': {
'label': '<code>&lt;s&gt;</code>'
},
'strike': {
'label': '<code>&lt;strike&gt;</code>'
},
'u': {
'label': '<code>&lt;u&gt;</code>'
},
'br + br': {
'label': 'Multiple <code>&lt;br&gt;</code>&rsquo;s (* not quite accurate)'
},
':contains("=NOTFOUND!")': {
'label': 'Missing SiteCore resource'
},
'abbr:not([title])': {
'label': '<code>&lt;abbr&gt;</code> missing <code>title</code>'
},
'acronym:not([title])': {
'label': '<code>&lt;acronym&gt;</code> missing <code>title</code>'
},
'a:contains("Click here"), a:contains("click here")': {
'label': '&ldquo;Click here&rdquo; used as link text'
},
'a:contains("Read more"), a:contains("Read more")': {
'label': '&ldquo;Read more&rdquo; used as link text'
},
'a:not([href])': {
'label': '<code>&lt;a&gt;</code> missing <code>href</code>'
},
'a[href=""]': {
'label': '<code>a[href=""]</code>'
},
'a[href="#"]': {
'label': '<code>a[href="#"]</code>'
},
'a[href*="javascript:"]': {
'label': '<code>a[href*="javascript:"]</code>'
},
'a[href*="<"]': {
'label': '<code>a[href*="<"]</code>'
},
'a[href*=">"]': {
'label': '<code>a[href*=">"]</code>'
},
'a[target]': {
'label': '<code>a[target]</code>'
},
'head script:not([src*="hasJS.js"], [src*="swfobject.js"], [src*="google-analytics.com"])': {
'label': '<code>&lt;script&gt;</code> in the <code>&lt;head&gt;</code>'
},
'fieldset:not(:has(legend))': {
'label': '<code>&lt;fieldset&gt;</code> missing <code>&lt;legend&gt;</code>'
},
'form[action=""]': {
'label': '<code>form[action=""]</code>'
},
'form[action="#"]': {
'label': '<code>form[action="#"]</code>'
},
'form:not(:has(fieldset))': {
'label': '<code>&lt;form&gt;</code> missing <code>&lt;fieldset&gt;</code>'
},
'input[type="text"]': {
'label': '<code>type="text"</code> is not needed on <code>&lt;input&gt;</code>'
},
'img:not([alt])': {
'label': '<code>&lt;img&gt;</code> missing <code>alt</code>'
},
'img:not(".tracking")[alt=""]': {
'label': '<code>img[alt=""]</code>'
},
'img[src=""]': {
'label': '<code>img[src=""]</code>'
},
'label:not([for])': {
'label': '<code>&lt;label&gt;</code> missing for'
},
'body link:not("#html-lint-css")': {
'label': '<code>&lt;link&gt;</code> not in <code>&lt;head&gt;</code>'
},
'link:not([rel])': {
'label': '<code>&lt;link&gt;</code> missing rel'
},
'link[charset]': {
'label': '<code>link[charset]</code>'
},
'link[rel="shortcut icon"][type="image/ico"]': {
'label': '<code>type="images/ico"</code> is not needed on <code>&lt;link&gt;</code>'
},
'link[rel="stylesheet"][media="all"]': {
'label': '<code>media="all"</code> is not needed on <code>&lt;link&gt;</code>'
},
'link[rel="stylesheet"][type="text/css"]': {
'label': '<code>type="text/css"</code> is not needed on <code>&lt;link&gt;</code>'
},
'script[charset]': {
'label': '<code>script[charset]</code>'
},
'script[language]': {
'label': '<code>language</code> attribute is not valid on <code>&lt;script&gt;</code>'
},
'script[type="text/javascript"]': {
'label': '<code>type="text/javascript"</code> is not needed on <code>&lt;script&gt;</code>'
},
'table:not([summary])': {
'label': '<code>&lt;table&gt;</code> missing <code>summary</code>'
},
'table:not(:has(caption))': {
'label': '<code>&lt;table&gt;</code> missing <code>&lt;caption&gt;</code>'
},
'table:not(:has(th))': {
'label': '<code>&lt;table&gt;</code> missing <code>&lt;th&gt;</code>'
},
'table table': {
'label': '<code>&lt;table&gt;</code> inside <code>&lt;table&gt;</code>'
},
'th:not([scope])': {
'label': '<code>&lt;th&gt;</code> missing scope'
},
'th[scope=""]': {
'label': '<code>th[scope=""]</code>'
},
':not("canvas, img, object")[width]': {
'label': 'Invalid attribute: <code>width</code>'
},
'[align]': {
'label': 'Invalid attribute: <code>align</code>'
},
'[alink]': {
'label': 'Bad attribute: <code>alink</code>'
},
'[background]': {
'label': 'Invalid attribute: <code>background</code>'
},
'[bgcolor]': {
'label': 'Invalid attribute: <code>bgcolor</code>'
},
'[border]': {
'label': 'Bad attribute: <code>border</code>'
},
'[cellpadding]': {
'label': 'Bad attribute: <code>cellpadding</code>'
},
'[cellspacing]': {
'label': 'Bad attribute: <code>cellspacing</code>'
},
'[class=""]': {
'label': '<code>class=""</code>'
},
'[halign]': {
'label': 'Invalid attribute: <code>halign</code>'
},
'[id=""]': {
'label': '<code>id=""</code>'
},
'[link]': {
'label': 'Bad attribute: <code>link</code>'
},
'[name=""]': {
'label': '<code>name=""</code>'
},
'[shape]': {
'label': 'Bad attribute: <code>shape</code>'
},
'[size]': {
'label': 'Bad attribute: <code>size</code>'
},
'[style*="background"]': {
'label': 'Inline style: <code>background</code>'
},
'[style*="border"]': {
'label': 'Inline style: <code>border</code>'
},
'[style*="font"]': {
'label': 'Inline style: <code>font</code>'
},
'[style*="letter-spacing"]': {
'label': 'Inline style: <code>letter-spacing</code>'
},
'[style*="line-height"]': {
'label': 'Inline style: <code>line-height</code>'
},
'[style*="list-style"]': {
'label': 'Inline style: <code>list-style</code>'
},
'[style*="outline"]': {
'label': 'Inline style: <code>outline</code>'
},
'[style*="resize"]': {
'label': 'Inline style: <code>resize</code>'
},
'[style*="text"]': {
'label': 'Inline style: <code>text</code>'
},
'[style*="vertical"]': {
'label': 'Inline style: <code>vertical</code>'
},
'[style*="word"]': {
'label': 'Inline style: <code>word</code>'
},
'[tabindex]': {
'label': 'Bad attribute: <code>tabindex</code>'
},
'[title=""]': {
'label': '<code>title</code> attribute is empty'
},
'[valign]': {
'label': 'Invalid attribute: <code>valign</code>'
},
'[vlink]': {
'label': 'Bad attribute: <code>vlink</code>'
},
'[onAbort]': {
'label': 'Bad attribute: <code>onAbort</code>'
},
'[onBlur]': {
'label': 'Bad attribute: <code>onBlur</code>'
},
'[onChange]': {
'label': 'Bad attribute: <code>onChange</code>'
},
'[onClick]': {
'label': 'Bad attribute: <code>onClick</code>'
},
'[onDblClick]': {
'label': 'Bad attribute: <code>onDblClick</code>'
},
'[onDragDrop]': {
'label': 'Bad attribute: <code>onDragDrop</code>'
},
'[onError]': {
'label': 'Bad attribute: <code>onError</code>'
},
'[onFocus]': {
'label': 'Bad attribute: <code>onFocus</code>'
},
'[onKeyDown]': {
'label': 'Bad attribute: <code>onKeyDown</code>'
},
'[onKeyPress]': {
'label': 'Bad attribute: <code>onKeyPress</code>'
},
'[onKeyUp]': {
'label': 'Bad attribute: <code>onKeyUp</code>'
},
'[onLoad]': {
'label': 'Bad attribute: <code>onLoad</code>'
},
'[onMouseDown]': {
'label': 'Bad attribute: <code>onMouseDown</code>'
},
'[onMouseMove]': {
'label': 'Bad attribute: <code>onMouseMove</code>'
},
'[onMouseOut]': {
'label': 'Bad attribute: <code>onMouseOut</code>'
},
'[onMouseOver]': {
'label': 'Bad attribute: <code>onMouseOver</code>'
},
'[onMouseUp]': {
'label': 'Bad attribute: <code>onMouseUp</code>'
},
'[onMove]': {
'label': 'Bad attribute: <code>onMove</code>'
},
'[onReset]': {
'label': 'Bad attribute: <code>onReset</code>'
},
'[onResize]': {
'label': 'Bad attribute: <code>onResize</code>'
},
'[onSelect]': {
'label': 'Bad attribute: <code>onSelect</code>'
},
'[onSubmit]': {
'label': 'Bad attribute: <code>onSubmit</code>'
},
'[onUnload]': {
'label': 'Bad attribute: <code>onUnload</code>'
},
'#ContentWrapper': {
'label': 'Bad Id: <code>ContentWrapper</code>'
},
'.MsoNormal': {
'label': 'Bad Class: <code>MsoNormal</code>'
}
}, function(pattern, payload) {
node = $(pattern);
node.jrumble();
node.trigger('startRumble');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment