forked from OfficeDev/office-ui-fabric-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- In the process of finding good HTML Linting software.
- Need to remove plugins that dont work as expected.
- Loading branch information
John Miller
committed
Dec 26, 2015
1 parent
42f530f
commit 1309c6c
Showing
7 changed files
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"doctype-first": "none", | ||
"line-end-style": "none", | ||
"spec-char-escape": true, | ||
"id-no-dup": true, | ||
"class-style": "none", | ||
"attr-name-style": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,32 +35,37 @@ gulp.task('FabricComponents-copyAssets', function () { | |
.pipe(gulp.dest(Config.paths.distComponents)); | ||
}); | ||
|
||
|
||
function htmllintReporter(filepath, issues) { | ||
if (issues.length > 0) { | ||
issues.forEach(function (issue) { | ||
gulputil.log(gulputil.colors.cyan('[gulp-htmllint] ') + gulputil.colors.white(filepath + ' [' + issue.line + ',' + issue.column + ']: ') + gulputil.colors.red('(' + issue.code + ') ' + issue.msg)); | ||
}); | ||
|
||
process.exitCode = 1; | ||
} | ||
} | ||
|
||
gulp.task('FabricComponents-copyAndParseHTML', function () { | ||
|
||
// Copy all Components files. | ||
return gulp.src(Config.paths.componentsPath + '/**/*.html') | ||
// Run HTML Tidy | ||
.pipe(Plugins.htmllint({ | ||
config: { | ||
'doctype-first': false, | ||
'line-end-style': false, | ||
'spec-char-escape': true, | ||
'id-no-dup': true, | ||
'class-style': false, | ||
'attr-name-style': false | ||
} | ||
}, htmllintReporter)) | ||
// .pipe(Plugins.htmllint({config: Config.htmlLintPath}, ErrorHandling.handlHTMLLintError)) | ||
.pipe(Plugins.verifyHTML({ | ||
showErrors: true, | ||
showWarnings: true, | ||
"doctype": "omit", | ||
"drop-empty-elements": false, | ||
"drop-empty-paras": false, | ||
}, function(err, html) { | ||
var newError = ''; | ||
// console.log(err); | ||
|
||
newError = err.replace('About this fork of Tidy: http://w3c.github.com/tidy-html5/', ''); | ||
newError = newError.replace('Bug reports and comments: https://github.com/w3c/tidy-html5/issues/', ''); | ||
newError = newError.replace('Or send questions and comments to [email protected]', ''); | ||
newError = newError.replace('Latest HTML specification: http://dev.w3.org/html5/spec-author-view/', ''); | ||
newError = newError.replace('HTML language reference: http://dev.w3.org/html5/markup/', ''); | ||
newError = newError.replace('Validate your HTML5 documents: http://validator.w3.org/nu/', ''); | ||
newError = newError.replace('Lobby your company to join the W3C: http://www.w3.org/Consortium', ''); | ||
|
||
if(newError.indexOf("\n") > -1) { | ||
console.log("Found error"); | ||
} | ||
|
||
console.log(newError); | ||
|
||
})) | ||
.on('error', ErrorHandling.onErrorInPipe) | ||
.pipe(Plugins.changed(Config.paths.distComponents)) | ||
.on('error', ErrorHandling.onErrorInPipe) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters