Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-rb-validate-html

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-rb-validate-html - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

38

index.js

@@ -176,3 +176,3 @@ /*jslint node: true*/

*/
function checkIndentation(file, indent) {
function checkIndentation(file, indent, checkInTags) {

@@ -183,3 +183,4 @@ var lines = file.split(/\r?\n/),

areacheck = "",
count = 0;
count = 0,
insideTag = false;

@@ -204,6 +205,14 @@ lines.forEach(function (line) {

// if whitespace remains -> wrong format
if (area.length > 0) {
if (area.length > 0 && (checkInTags || !insideTag)) {
validationError('Wrong indentation (line ' + count + '). Use auto formatter', line, 'CI-FE-2001', false);
}
}
// opening tag / closing tag?
if ((line.match(/</g) || []).length > (line.match(/>/g) || []).length) {
insideTag = true;
} else if ((line.match(/</g) || []).length < (line.match(/>/g) || []).length) {
insideTag = false;
}
});

@@ -238,11 +247,14 @@ }

}
if (typeof options.checkviewport !== 'boolean') {
options.checkviewport = true;
if (typeof options.checkViewport !== 'boolean') {
options.checkViewport = true;
}
if (typeof options.checkindent !== 'boolean') {
options.checkindent = true;
if (typeof options.checkIndent !== 'boolean') {
options.checkIndent = true;
}
if (typeof options.checkremote !== 'boolean') {
options.checkremote = true;
if (typeof options.checkIndentInTags !== 'boolean') {
options.checkIndentInTags = false;
}
if (typeof options.checkRemote !== 'boolean') {
options.checkRemote = true;
}

@@ -261,11 +273,11 @@ var errorOutputList = [];

parseHTML(str, options.checkremote);
parseHTML(str, options.checkRemote);
singleQuotes(str);
bodyStylesheet(str);
if (options.checkindent) {
checkIndentation(str, options.indent);
if (options.checkIndent) {
checkIndentation(str, options.indent, options.checkIndentInTags);
}
if (options.checkviewport) {
if (options.checkViewport) {
checkViewport(str);

@@ -272,0 +284,0 @@ }

{
"name": "gulp-rb-validate-html",
"version": "0.0.7",
"version": "0.0.8",
"description": "Gulp plugin to validate HTML files according to Web Frontend Guidelines",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -47,4 +47,4 @@ #Installation

indent: '\t',
checkremote: false,
checkviewport: false
checkRemote: false,
checkViewport: false
});

@@ -65,12 +65,16 @@

#### checkindent: Boolean (Default: true)
#### checkIndentInTags: Boolean (Default: false)
Set to true to activate indentation checks inside HTML tags (between < and >)
#### checkIndent: Boolean (Default: true)
Set to false to deactivate indentation checks altogether
#### checkremote: Boolean (Default: true)
#### checkRemote: Boolean (Default: true)
Set to false to deactivate all warnings caused by remote resource URLs in HTML code
#### checkviewport: Boolean (Default: true)
#### checkViewport: Boolean (Default: true)
Set to false if the application is not responsive/for mobile devices
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc