New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@markuplint/rules

Package Overview
Dependencies
Maintainers
1
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markuplint/rules - npm Package Compare versions

Comparing version 1.0.0-alpha.15 to 1.0.0-alpha.16

84

lib/permitted-contents/index.js

@@ -91,15 +91,21 @@ "use strict";

if (matched) {
parentExp = getRegExpFromParentNode(node, expGen);
exp = expGen.specToRegExp(conditional.contents, parentExp);
conditionalResult = match(exp, nodes);
if (!conditionalResult) {
reports.push({
severity: node.rule.severity,
message: messages("Invalid content in \"" + node.nodeName + "\" element on the HTML spec"),
line: node.startLine,
col: node.startCol,
raw: node.raw,
});
break;
try {
parentExp = getRegExpFromParentNode(node, expGen);
exp = expGen.specToRegExp(conditional.contents, parentExp);
conditionalResult = match(exp, nodes);
if (!conditionalResult) {
reports.push({
severity: node.rule.severity,
message: messages("Invalid content in \"" + node.nodeName + "\" element on the HTML spec"),
line: node.startLine,
col: node.startCol,
raw: node.raw,
});
break;
}
}
catch (e) {
// eslint-disable-next-line no-console
console.warn(node.raw, 'conditional', conditional, e.message);
}
}

@@ -109,13 +115,19 @@ }

if (!matched) {
exp = getRegExpFromNode(node, expGen);
specResult = match(exp, nodes);
if (!specResult) {
reports.push({
severity: node.rule.severity,
message: messages("Invalid content in \"" + node.nodeName + "\" element on the HTML spec"),
line: node.startLine,
col: node.startCol,
raw: node.raw,
});
try {
exp = getRegExpFromNode(node, expGen);
specResult = match(exp, nodes);
if (!specResult) {
reports.push({
severity: node.rule.severity,
message: messages("Invalid content in \"" + node.nodeName + "\" element on the HTML spec"),
line: node.startLine,
col: node.startCol,
raw: node.raw,
});
}
}
catch (e) {
// eslint-disable-next-line no-console
console.warn(node.raw, 'HTML Spec', e.message);
}
}

@@ -129,14 +141,20 @@ }

parentExp = getRegExpFromParentNode(node, expGen);
exp = expGen.specToRegExp(rule.contents, parentExp);
r = match(exp, nodes);
if (!r) {
reports.push({
severity: node.rule.severity,
message: messages("Invalid content in \"" + node.nodeName + "\" element on rule settings"),
line: node.startLine,
col: node.startCol,
raw: node.raw,
});
return [2 /*return*/];
try {
exp = expGen.specToRegExp(rule.contents, parentExp);
r = match(exp, nodes);
if (!r) {
reports.push({
severity: node.rule.severity,
message: messages("Invalid content in \"" + node.nodeName + "\" element on rule settings"),
line: node.startLine,
col: node.startCol,
raw: node.raw,
});
return [2 /*return*/];
}
}
catch (e) {
// eslint-disable-next-line no-console
console.warn(node.raw, 'rule', rule, e.message);
}
}

@@ -143,0 +161,0 @@ return [2 /*return*/];

@@ -148,3 +148,5 @@ "use strict";

var interleave = contents.map(function (content) { return _this._toPattern(content, null, 1, 1); });
var patterns = array_combination_1.default(interleave).map(function (pattern) { return pattern.join(''); });
var patterns = array_combination_1.default(interleave).map(function (pattern, i) {
return pattern.join('').replace(/(\(\?<[A-Z]+_)([0-9]+)_/g, function ($0, $1, $2) { return "" + $1 + $2 + i + "_"; });
});
return join(patterns);

@@ -151,0 +153,0 @@ };

{
"name": "@markuplint/rules",
"version": "1.0.0-alpha.15",
"version": "1.0.0-alpha.16",
"description": "Rules for markuplint",

@@ -25,3 +25,3 @@ "repository": "git@github.com:markuplint/markuplint.git",

},
"gitHead": "234c94d0083045c5ae3fa54bfc52cb40b364eefd"
"gitHead": "59e18617a969b2f3841dd65e444634feaec44f19"
}

Sorry, the diff of this file is not supported yet

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