diff --git a/dist/core/rules/index.js b/dist/core/rules/index.js index b3af49edb..19371ea9d 100644 --- a/dist/core/rules/index.js +++ b/dist/core/rules/index.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.titleRequire = exports.tagSelfClose = exports.tagsCheck = exports.tagPair = exports.tagnameSpecialChars = exports.tagnameLowercase = exports.styleDisabled = exports.srcNotEmpty = exports.specCharEscape = exports.spaceTabMixedDisabled = exports.scriptDisabled = exports.inputRequiresLabel = exports.inlineStyleDisabled = exports.inlineScriptDisabled = exports.idUnique = exports.idClassValue = exports.idClassAdDisabled = exports.htmlLangRequire = exports.hrefAbsOrRel = exports.headScriptDisabled = exports.h1Require = exports.emptyTagNotSelfClosed = exports.doctypeHTML5 = exports.doctypeFirst = exports.attrWhitespace = exports.attrValueSingleQuotes = exports.attrValueNotEmpty = exports.attrValueDoubleQuotes = exports.attrUnsafeChars = exports.attrSort = exports.attrNoUnnecessaryWhitespace = exports.attrNoDuplication = exports.attrLowercase = exports.altRequire = void 0; +exports.titleRequire = exports.tagSelfClose = exports.tagsCheck = exports.tagPair = exports.tagnameSpecialChars = exports.tagnameLowercase = exports.styleDisabled = exports.srcNotEmpty = exports.specCharEscape = exports.spaceTabMixedDisabled = exports.scriptDisabled = exports.mainRequire = exports.inputRequiresLabel = exports.inlineStyleDisabled = exports.inlineScriptDisabled = exports.idUnique = exports.idClassValue = exports.idClassAdDisabled = exports.htmlLangRequire = exports.hrefAbsOrRel = exports.headScriptDisabled = exports.h1Require = exports.emptyTagNotSelfClosed = exports.doctypeHTML5 = exports.doctypeFirst = exports.attrWhitespace = exports.attrValueSingleQuotes = exports.attrValueNotEmpty = exports.attrValueDoubleQuotes = exports.attrUnsafeChars = exports.attrSort = exports.attrNoUnnecessaryWhitespace = exports.attrNoDuplication = exports.attrLowercase = exports.altRequire = void 0; var alt_require_1 = require("./alt-require"); Object.defineProperty(exports, "altRequire", { enumerable: true, get: function () { return alt_require_1.default; } }); var attr_lowercase_1 = require("./attr-lowercase"); @@ -47,6 +47,8 @@ var inline_style_disabled_1 = require("./inline-style-disabled"); Object.defineProperty(exports, "inlineStyleDisabled", { enumerable: true, get: function () { return inline_style_disabled_1.default; } }); var input_requires_label_1 = require("./input-requires-label"); Object.defineProperty(exports, "inputRequiresLabel", { enumerable: true, get: function () { return input_requires_label_1.default; } }); +var main_require_1 = require("./main-require"); +Object.defineProperty(exports, "mainRequire", { enumerable: true, get: function () { return main_require_1.default; } }); var script_disabled_1 = require("./script-disabled"); Object.defineProperty(exports, "scriptDisabled", { enumerable: true, get: function () { return script_disabled_1.default; } }); var space_tab_mixed_disabled_1 = require("./space-tab-mixed-disabled"); @@ -69,4 +71,4 @@ var tag_self_close_1 = require("./tag-self-close"); Object.defineProperty(exports, "tagSelfClose", { enumerable: true, get: function () { return tag_self_close_1.default; } }); var title_require_1 = require("./title-require"); Object.defineProperty(exports, "titleRequire", { enumerable: true, get: function () { return title_require_1.default; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29yZS9ydWxlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2Q0FBcUQ7QUFBNUMseUdBQUEsT0FBTyxPQUFjO0FBQzlCLG1EQUEyRDtBQUFsRCwrR0FBQSxPQUFPLE9BQWlCO0FBQ2pDLDZEQUFvRTtBQUEzRCx3SEFBQSxPQUFPLE9BQXFCO0FBQ3JDLG1GQUF5RjtBQUFoRiw2SUFBQSxPQUFPLE9BQStCO0FBQy9DLDZDQUFtRDtBQUExQyx1R0FBQSxPQUFPLE9BQVk7QUFDNUIseURBQWdFO0FBQXZELG9IQUFBLE9BQU8sT0FBbUI7QUFDbkMsdUVBQTZFO0FBQXBFLGlJQUFBLE9BQU8sT0FBeUI7QUFDekMsK0RBQXFFO0FBQT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0IifQ== \ No newline at end of file diff --git a/dist/htmlhint.js b/dist/htmlhint.js index 8fb131b64..166bfb076 100644 --- a/dist/htmlhint.js +++ b/dist/htmlhint.js @@ -1329,6 +1329,58 @@ return inputRequiresLabel; } + var mainRequire = {}; + + var hasRequiredMainRequire; + + function requireMainRequire () { + if (hasRequiredMainRequire) return mainRequire; + hasRequiredMainRequire = 1; + Object.defineProperty(mainRequire, "__esModule", { value: true }); + mainRequire.default = { + id: 'main-require', + description: '
must be present in tag.', + init(parser, reporter) { + let bodyDepth = 0; + let hasMainInBody = false; + let bodyTagEvent = null; + const onTagStart = (event) => { + const tagName = event.tagName.toLowerCase(); + if (tagName === 'body') { + bodyDepth++; + if (bodyDepth === 1) { + hasMainInBody = false; + bodyTagEvent = event; + } + } + else if (tagName === 'main' && bodyDepth > 0) { + hasMainInBody = true; + } + }; + const onTagEnd = (event) => { + const tagName = event.tagName.toLowerCase(); + if (tagName === 'body') { + if (bodyDepth === 1 && !hasMainInBody && bodyTagEvent) { + reporter.warn('
must be present in tag.', bodyTagEvent.line, bodyTagEvent.col, this, bodyTagEvent.raw); + } + bodyDepth--; + if (bodyDepth < 0) + bodyDepth = 0; + } + }; + parser.addListener('tagstart', onTagStart); + parser.addListener('tagend', onTagEnd); + parser.addListener('end', () => { + if (bodyDepth > 0 && !hasMainInBody && bodyTagEvent) { + reporter.warn('
must be present in tag.', bodyTagEvent.line, bodyTagEvent.col, this, bodyTagEvent.raw); + } + }); + }, + }; + + return mainRequire; + } + var scriptDisabled = {}; var hasRequiredScriptDisabled; @@ -1804,7 +1856,7 @@ hasRequiredRules = 1; (function (exports) { Object.defineProperty(exports, "__esModule", { value: true }); - exports.titleRequire = exports.tagSelfClose = exports.tagsCheck = exports.tagPair = exports.tagnameSpecialChars = exports.tagnameLowercase = exports.styleDisabled = exports.srcNotEmpty = exports.specCharEscape = exports.spaceTabMixedDisabled = exports.scriptDisabled = exports.inputRequiresLabel = exports.inlineStyleDisabled = exports.inlineScriptDisabled = exports.idUnique = exports.idClassValue = exports.idClassAdDisabled = exports.htmlLangRequire = exports.hrefAbsOrRel = exports.headScriptDisabled = exports.h1Require = exports.emptyTagNotSelfClosed = exports.doctypeHTML5 = exports.doctypeFirst = exports.attrWhitespace = exports.attrValueSingleQuotes = exports.attrValueNotEmpty = exports.attrValueDoubleQuotes = exports.attrUnsafeChars = exports.attrSort = exports.attrNoUnnecessaryWhitespace = exports.attrNoDuplication = exports.attrLowercase = exports.altRequire = void 0; + exports.titleRequire = exports.tagSelfClose = exports.tagsCheck = exports.tagPair = exports.tagnameSpecialChars = exports.tagnameLowercase = exports.styleDisabled = exports.srcNotEmpty = exports.specCharEscape = exports.spaceTabMixedDisabled = exports.scriptDisabled = exports.mainRequire = exports.inputRequiresLabel = exports.inlineStyleDisabled = exports.inlineScriptDisabled = exports.idUnique = exports.idClassValue = exports.idClassAdDisabled = exports.htmlLangRequire = exports.hrefAbsOrRel = exports.headScriptDisabled = exports.h1Require = exports.emptyTagNotSelfClosed = exports.doctypeHTML5 = exports.doctypeFirst = exports.attrWhitespace = exports.attrValueSingleQuotes = exports.attrValueNotEmpty = exports.attrValueDoubleQuotes = exports.attrUnsafeChars = exports.attrSort = exports.attrNoUnnecessaryWhitespace = exports.attrNoDuplication = exports.attrLowercase = exports.altRequire = void 0; var alt_require_1 = requireAltRequire(); Object.defineProperty(exports, "altRequire", { enumerable: true, get: function () { return alt_require_1.default; } }); var attr_lowercase_1 = requireAttrLowercase(); @@ -1851,6 +1903,8 @@ Object.defineProperty(exports, "inlineStyleDisabled", { enumerable: true, get: function () { return inline_style_disabled_1.default; } }); var input_requires_label_1 = requireInputRequiresLabel(); Object.defineProperty(exports, "inputRequiresLabel", { enumerable: true, get: function () { return input_requires_label_1.default; } }); + var main_require_1 = requireMainRequire(); + Object.defineProperty(exports, "mainRequire", { enumerable: true, get: function () { return main_require_1.default; } }); var script_disabled_1 = requireScriptDisabled(); Object.defineProperty(exports, "scriptDisabled", { enumerable: true, get: function () { return script_disabled_1.default; } }); var space_tab_mixed_disabled_1 = requireSpaceTabMixedDisabled(); diff --git a/dist/htmlhint.min.js b/dist/htmlhint.min.js index 1d05705cf..90af01740 100644 --- a/dist/htmlhint.min.js +++ b/dist/htmlhint.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).HTMLHint=t()}(this,(function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,a={},r={};var n,s={};var i,l={},o={};var d,u={};var c,f={};var h,g={};var p,m={};var b,v={};var y,w={};var L,O={};var x,j={};var P,_={};var $,T={};var A,M={};var C,N={};var k,q={};var E,R={};var S,z={};var D,U={};var Z,H={};var I,F={};var V,W={};var B,Y={};var J,Q={};var X,G={};function K(){return X||(X=1,Object.defineProperty(G,"__esModule",{value:!0}),G.default={id:"input-requires-label",description:"All [ input ] tags must have a corresponding [ label ] tag. ",init(e,t){const a=[],r=[];e.addListener("tagstart",(t=>{const n=t.tagName.toLowerCase(),s=e.getMapAttrs(t.attrs),i=t.col+n.length+1;"input"===n&&"hidden"!==s.type&&r.push({event:t,col:i,id:s.id}),"label"===n&&"for"in s&&""!==s.for&&a.push({event:t,col:i,forValue:s.for})})),e.addListener("end",(()=>{r.forEach((e=>{(function(e){let t=!1;return a.forEach((a=>{e.id&&e.id===a.forValue&&(t=!0)})),t})(e)||t.warn("No matching [ label ] tag found.",e.event.line,e.col,this,e.event.raw)}))}))}}),G}var ee,te={};var ae,re={};var ne,se={};var ie,le={};var oe,de={};var ue,ce={};var fe,he={};var ge,pe={};var me,be={};var ve,ye={};var we,Le,Oe,xe={};function je(){return Le||(Le=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.titleRequire=e.tagSelfClose=e.tagsCheck=e.tagPair=e.tagnameSpecialChars=e.tagnameLowercase=e.styleDisabled=e.srcNotEmpty=e.specCharEscape=e.spaceTabMixedDisabled=e.scriptDisabled=e.inputRequiresLabel=e.inlineStyleDisabled=e.inlineScriptDisabled=e.idUnique=e.idClassValue=e.idClassAdDisabled=e.htmlLangRequire=e.hrefAbsOrRel=e.headScriptDisabled=e.h1Require=e.emptyTagNotSelfClosed=e.doctypeHTML5=e.doctypeFirst=e.attrWhitespace=e.attrValueSingleQuotes=e.attrValueNotEmpty=e.attrValueDoubleQuotes=e.attrUnsafeChars=e.attrSort=e.attrNoUnnecessaryWhitespace=e.attrNoDuplication=e.attrLowercase=e.altRequire=void 0;var t=(i||(i=1,Object.defineProperty(o,"__esModule",{value:!0}),o.default={id:"alt-require",description:"The alt attribute of an element must be present and alt attribute of area[href] and input[type=image] must have a value.",init(e,t){e.addListener("tagstart",(a=>{const r=a.tagName.toLowerCase(),n=e.getMapAttrs(a.attrs),s=a.col+r.length+1;let i;"img"!==r||"alt"in n?("area"===r&&"href"in n||"input"===r&&"image"===n.type)&&("alt"in n&&""!==n.alt||(i="area"===r?"area[href]":"input[type=image]",t.warn(`The alt attribute of ${i} must have a value.`,a.line,s,this,a.raw))):t.warn("An alt attribute must be present on elements.",a.line,s,this,a.raw)}))}}),o);Object.defineProperty(e,"altRequire",{enumerable:!0,get:function(){return t.default}});var a=function(){if(d)return u;d=1,Object.defineProperty(u,"__esModule",{value:!0});const e=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPath","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","onBlur","onChange","onClick","onFocus","onKeyUp","onLoad","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"];function t(e,t){if(t instanceof RegExp)return!!t.test(e)&&{match:e,pattern:t};const a=t[0],r=t[t.length-1],n=t[t.length-2],s="/"===a&&("/"===r||"/"===n&&"i"===r);return s?s&&"i"===r?new RegExp(t.slice(1,-2),"i").test(e):new RegExp(t.slice(1,-1)).test(e):e===t}return u.default={id:"attr-lowercase",description:"All attribute names must be in lowercase.",init(a,r,n){const s=(Array.isArray(n)?n:[]).concat(e);a.addListener("tagstart",(e=>{const a=e.attrs;let n;const i=e.col+e.tagName.length+1;for(let l=0,o=a.length;lt(o,e)))||o===o.toLowerCase()||r.error(`The attribute name of [ ${o} ] must be in lowercase.`,e.line,i+n.index,this,n.raw)}}))}},u}();Object.defineProperty(e,"attrLowercase",{enumerable:!0,get:function(){return a.default}});var r=(c||(c=1,Object.defineProperty(f,"__esModule",{value:!0}),f.default={id:"attr-no-duplication",description:"Elements cannot have duplicate attributes.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r,n;const s=e.col+e.tagName.length+1,i={};for(let l=0,o=a.length;l{const a=e.attrs,n=e.col+e.tagName.length+1;for(let s=0;s{const r=e.attrs,n=[];for(let e=0;evoid 0!==a[e]?void 0!==a[t]?a[e]-a[t]:-1:e.startsWith("data-")?t.startsWith("data-")?e.localeCompare(t):1:void 0!==a[t]?1:t.startsWith("data-")?-1:e.localeCompare(t))),s!==JSON.stringify(n)&&t.error(`Inaccurate order ${s} should be in hierarchy ${JSON.stringify(n)} `,e.line,e.col,this,e.raw)}))}}),m);Object.defineProperty(e,"attrSort",{enumerable:!0,get:function(){return s.default}});var l=(b||(b=1,Object.defineProperty(v,"__esModule",{value:!0}),v.default={id:"attr-unsafe-chars",description:"Attribute values cannot contain unsafe chars.",init(e,t){e.addListener("tagstart",(e=>{const a=e.attrs;let r;const n=e.col+e.tagName.length+1,s=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;let i;for(let l=0,o=a.length;l{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;for(let s=0,i=a.length;s{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;for(let s=0,i=a.length;s{const a=e.attrs;let r;const n=e.col+e.tagName.length+1;for(let s=0,i=a.length;s{const a=e.attrs;let n;const s=e.col+e.tagName.length+1;a.forEach((a=>{n=a;const i=a.name;-1===r.indexOf(i)&&(a.value.trim()!==a.value&&t.error(`The attributes of [ ${i} ] must not have leading or trailing whitespace.`,e.line,s+n.index,this,n.raw),a.value.replace(/ +(?= )/g,"")!==a.value&&t.error(`The attributes of [ ${i} ] must be separated by only one space.`,e.line,s+n.index,this,n.raw))}))}))}}),_);Object.defineProperty(e,"attrWhitespace",{enumerable:!0,get:function(){return Oe.default}});var je=($||($=1,Object.defineProperty(T,"__esModule",{value:!0}),T.default={id:"doctype-first",description:"Doctype must be declared first.",init(e,t){const a=r=>{"start"===r.type||"text"===r.type&&/^\s*$/.test(r.raw)||(("comment"!==r.type&&!1===r.long||!1===/^DOCTYPE\s+/i.test(r.content))&&t.error("Doctype must be declared first.",r.line,r.col,this,r.raw),e.removeListener("all",a))};e.addListener("all",a)}}),T);Object.defineProperty(e,"doctypeFirst",{enumerable:!0,get:function(){return je.default}});var Pe=(A||(A=1,Object.defineProperty(M,"__esModule",{value:!0}),M.default={id:"doctype-html5",description:'Invalid doctype. Use: ""',init(e,t){const a=e=>{!1===e.long&&"doctype html"!==e.content.toLowerCase()&&t.warn('Invalid doctype. Use: ""',e.line,e.col,this,e.raw)},r=()=>{e.removeListener("comment",a),e.removeListener("tagstart",r)};e.addListener("all",a),e.addListener("tagstart",r)}}),M);Object.defineProperty(e,"doctypeHTML5",{enumerable:!0,get:function(){return Pe.default}});var _e=(C||(C=1,Object.defineProperty(N,"__esModule",{value:!0}),N.default={id:"empty-tag-not-self-closed",description:"Empty tags must not use self closed syntax.",init(e,t){const a=e.makeMap("area,base,basefont,bgsound,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(e=>{const r=e.tagName.toLowerCase();void 0!==a[r]&&e.close&&t.error(`The empty tag : [ ${r} ] must not use self closed syntax.`,e.line,e.col,this,e.raw)}))}}),N);Object.defineProperty(e,"emptyTagNotSelfClosed",{enumerable:!0,get:function(){return _e.default}});var $e=(k||(k=1,Object.defineProperty(q,"__esModule",{value:!0}),q.default={id:"h1-require",description:"

must be present in tag and not be empty.",init(e,t){let a=0,r=!1,n=null,s=null,i=!1;e.addListener("tagstart",(e=>{const t=e.tagName.toLowerCase();"body"===t?(a++,1===a&&(r=!1,n=e)):"h1"===t&&a>0&&(r=!0,s=e,i=!0)})),e.addListener("tagend",(e=>{const l=e.tagName.toLowerCase();"h1"===l&&s?(i&&t.warn("

tag must not be empty.",s.line,s.col,this,s.raw),s=null):"body"===l&&(1===a&&!r&&n&&t.warn("

must be present in tag.",n.line,n.col,this,n.raw),a--,a<0&&(a=0))})),e.addListener("text",(e=>{s&&i&&e.raw&&!/^\s*$/.test(e.raw)&&(i=!1)})),e.addListener("end",(()=>{a>0&&!r&&n&&t.warn("

must be present in tag.",n.line,n.col,this,n.raw)}))}}),q);Object.defineProperty(e,"h1Require",{enumerable:!0,get:function(){return $e.default}});var Te=(E||(E=1,Object.defineProperty(R,"__esModule",{value:!0}),R.default={id:"head-script-disabled",description:"The