html-validate 6.3.2 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.d.ts +10 -1
- package/dist/cjs/core.js +20 -7
- package/dist/cjs/core.js.map +1 -1
- package/dist/es/core.d.ts +10 -1
- package/dist/es/core.js +20 -7
- package/dist/es/core.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/core.d.ts
CHANGED
|
@@ -502,6 +502,8 @@ interface ConditionalEvent extends Event {
|
|
|
502
502
|
location: Location;
|
|
503
503
|
/** Condition including markers. */
|
|
504
504
|
condition: string;
|
|
505
|
+
/** The element containing the conditional, if any. */
|
|
506
|
+
parent: HtmlElement | null;
|
|
505
507
|
}
|
|
506
508
|
/**
|
|
507
509
|
* Event emitted when html-validate directives `<!-- [html-validate-...] -->`
|
|
@@ -651,10 +653,17 @@ declare class Parser {
|
|
|
651
653
|
*/
|
|
652
654
|
private getAttributeLocation;
|
|
653
655
|
protected consumeDirective(token: Token): void;
|
|
656
|
+
/**
|
|
657
|
+
* Consumes conditional comment in tag form.
|
|
658
|
+
*
|
|
659
|
+
* See also the related [[consumeCommend]] method.
|
|
660
|
+
*/
|
|
661
|
+
protected consumeConditional(token: Token): void;
|
|
654
662
|
/**
|
|
655
663
|
* Consumes comment token.
|
|
656
664
|
*
|
|
657
|
-
* Tries to find IE conditional comments and emits conditional token if
|
|
665
|
+
* Tries to find IE conditional comments and emits conditional token if
|
|
666
|
+
* found. See also the related [[consumeConditional]] method.
|
|
658
667
|
*/
|
|
659
668
|
protected consumeComment(token: Token): void;
|
|
660
669
|
/**
|
package/dist/cjs/core.js
CHANGED
|
@@ -2956,7 +2956,7 @@ var TRANSFORMER_API;
|
|
|
2956
2956
|
/** @public */
|
|
2957
2957
|
const name = "html-validate";
|
|
2958
2958
|
/** @public */
|
|
2959
|
-
const version = "6.
|
|
2959
|
+
const version = "6.4.0";
|
|
2960
2960
|
/** @public */
|
|
2961
2961
|
const homepage = "https://html-validate.org";
|
|
2962
2962
|
/** @public */
|
|
@@ -5998,7 +5998,7 @@ class NoConditionalComment extends Rule {
|
|
|
5998
5998
|
}
|
|
5999
5999
|
setup() {
|
|
6000
6000
|
this.on("conditional", (event) => {
|
|
6001
|
-
this.report(
|
|
6001
|
+
this.report(event.parent, "Use of conditional comments are deprecated", event.location);
|
|
6002
6002
|
});
|
|
6003
6003
|
}
|
|
6004
6004
|
}
|
|
@@ -10495,10 +10495,7 @@ class Parser {
|
|
|
10495
10495
|
this.consumeDirective(token);
|
|
10496
10496
|
break;
|
|
10497
10497
|
case exports.TokenType.CONDITIONAL:
|
|
10498
|
-
this.
|
|
10499
|
-
condition: token.data[1],
|
|
10500
|
-
location: token.location,
|
|
10501
|
-
});
|
|
10498
|
+
this.consumeConditional(token);
|
|
10502
10499
|
break;
|
|
10503
10500
|
case exports.TokenType.COMMENT:
|
|
10504
10501
|
this.consumeComment(token);
|
|
@@ -10803,17 +10800,33 @@ class Parser {
|
|
|
10803
10800
|
location: token.location,
|
|
10804
10801
|
});
|
|
10805
10802
|
}
|
|
10803
|
+
/**
|
|
10804
|
+
* Consumes conditional comment in tag form.
|
|
10805
|
+
*
|
|
10806
|
+
* See also the related [[consumeCommend]] method.
|
|
10807
|
+
*/
|
|
10808
|
+
consumeConditional(token) {
|
|
10809
|
+
const element = this.dom.getActive();
|
|
10810
|
+
this.trigger("conditional", {
|
|
10811
|
+
condition: token.data[1],
|
|
10812
|
+
location: token.location,
|
|
10813
|
+
parent: element,
|
|
10814
|
+
});
|
|
10815
|
+
}
|
|
10806
10816
|
/**
|
|
10807
10817
|
* Consumes comment token.
|
|
10808
10818
|
*
|
|
10809
|
-
* Tries to find IE conditional comments and emits conditional token if
|
|
10819
|
+
* Tries to find IE conditional comments and emits conditional token if
|
|
10820
|
+
* found. See also the related [[consumeConditional]] method.
|
|
10810
10821
|
*/
|
|
10811
10822
|
consumeComment(token) {
|
|
10812
10823
|
const comment = token.data[0];
|
|
10824
|
+
const element = this.dom.getActive();
|
|
10813
10825
|
for (const conditional of parseConditionalComment(comment, token.location)) {
|
|
10814
10826
|
this.trigger("conditional", {
|
|
10815
10827
|
condition: conditional.expression,
|
|
10816
10828
|
location: conditional.location,
|
|
10829
|
+
parent: element,
|
|
10817
10830
|
});
|
|
10818
10831
|
}
|
|
10819
10832
|
}
|