html-validate 7.15.0 → 7.15.1

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.js CHANGED
@@ -614,6 +614,8 @@ class DOMNode {
614
614
  }
615
615
  /**
616
616
  * Tests if two nodes are the same (references the same object).
617
+ *
618
+ * @since v4.11.0
617
619
  */
618
620
  isSameNode(otherNode) {
619
621
  return this.unique === otherNode.unique;
@@ -2506,7 +2508,7 @@ class MetaTable {
2506
2508
  /**
2507
2509
  * Extend validation schema.
2508
2510
  *
2509
- * @internal
2511
+ * @public
2510
2512
  */
2511
2513
  extendValidationSchema(patch) {
2512
2514
  if (patch.properties) {
@@ -2527,7 +2529,7 @@ class MetaTable {
2527
2529
  /**
2528
2530
  * Load metadata table from object.
2529
2531
  *
2530
- * @internal
2532
+ * @public
2531
2533
  * @param obj - Object with metadata to load
2532
2534
  * @param filename - Optional filename used when presenting validation error
2533
2535
  */
@@ -2548,7 +2550,7 @@ class MetaTable {
2548
2550
  /**
2549
2551
  * Load metadata table from filename
2550
2552
  *
2551
- * @internal
2553
+ * @public
2552
2554
  * @param filename - Filename to load
2553
2555
  */
2554
2556
  loadFromFile(filename) {
@@ -10112,7 +10114,7 @@ class Config {
10112
10114
  * A resolved configuration will merge all extended configs and load all
10113
10115
  * plugins and transformers, and normalize the rest of the configuration.
10114
10116
  *
10115
- * @internal
10117
+ * @public
10116
10118
  */
10117
10119
  resolve() {
10118
10120
  return new ResolvedConfig(this.resolveData());
@@ -10393,12 +10395,13 @@ function isValidDirective(action) {
10393
10395
  /**
10394
10396
  * Parse HTML document into a DOM tree.
10395
10397
  *
10396
- * @internal
10398
+ * @public
10397
10399
  */
10398
10400
  class Parser {
10399
10401
  /**
10400
10402
  * Create a new parser instance.
10401
10403
  *
10404
+ * @public
10402
10405
  * @param config - Configuration
10403
10406
  */
10404
10407
  constructor(config) {
@@ -10410,6 +10413,7 @@ class Parser {
10410
10413
  /**
10411
10414
  * Parse HTML markup.
10412
10415
  *
10416
+ * @public
10413
10417
  * @param source - HTML markup.
10414
10418
  * @returns DOM tree representing the HTML markup.
10415
10419
  */
@@ -10500,6 +10504,9 @@ class Parser {
10500
10504
  return Boolean(active.parent && active.parent.is(tagName) && meta.includes(active.tagName));
10501
10505
  }
10502
10506
  }
10507
+ /**
10508
+ * @internal
10509
+ */
10503
10510
  /* eslint-disable-next-line complexity -- there isn't really a good other way to structure this method (that is still readable) */
10504
10511
  consume(source, token, tokenStream) {
10505
10512
  switch (token.type) {
@@ -10537,6 +10544,9 @@ class Parser {
10537
10544
  break;
10538
10545
  }
10539
10546
  }
10547
+ /**
10548
+ * @internal
10549
+ */
10540
10550
  /* eslint-disable-next-line complexity, sonarjs/cognitive-complexity -- technical debt, chould be refactored a bit */
10541
10551
  consumeTag(source, startToken, tokenStream) {
10542
10552
  const tokens = Array.from(this.consumeUntil(tokenStream, TokenType.TAG_CLOSE, startToken.location));
@@ -10602,6 +10612,9 @@ class Parser {
10602
10612
  this.discardForeignBody(source, node.tagName, tokenStream, startToken.location);
10603
10613
  }
10604
10614
  }
10615
+ /**
10616
+ * @internal
10617
+ */
10605
10618
  closeElement(source, node, active, location) {
10606
10619
  /* call processElement hook */
10607
10620
  this.processElement(active, source);
@@ -10637,6 +10650,8 @@ class Parser {
10637
10650
  }
10638
10651
  /**
10639
10652
  * Discard tokens until the end tag for the foreign element is found.
10653
+ *
10654
+ * @internal
10640
10655
  */
10641
10656
  discardForeignBody(source, foreignTagName, tokenStream, errorLocation) {
10642
10657
  /* consume elements until the end tag for this foreign element is found */
@@ -10685,6 +10700,9 @@ class Parser {
10685
10700
  this.closeElement(source, node, active, endToken.location);
10686
10701
  this.dom.popActive();
10687
10702
  }
10703
+ /**
10704
+ * @internal
10705
+ */
10688
10706
  consumeAttribute(source, node, token, next) {
10689
10707
  const keyLocation = this.getAttributeKeyLocation(token);
10690
10708
  const valueLocation = this.getAttributeValueLocation(next);
@@ -10775,6 +10793,9 @@ class Parser {
10775
10793
  offset: begin.offset,
10776
10794
  };
10777
10795
  }
10796
+ /**
10797
+ * @internal
10798
+ */
10778
10799
  consumeDirective(token) {
10779
10800
  const [text, preamble, action, separator1, directive, postamble] = token.data;
10780
10801
  if (!postamble.startsWith("]")) {
@@ -10820,6 +10841,8 @@ class Parser {
10820
10841
  * Consumes conditional comment in tag form.
10821
10842
  *
10822
10843
  * See also the related [[consumeCommend]] method.
10844
+ *
10845
+ * @internal
10823
10846
  */
10824
10847
  consumeConditional(token) {
10825
10848
  const element = this.dom.getActive();
@@ -10834,6 +10857,8 @@ class Parser {
10834
10857
  *
10835
10858
  * Tries to find IE conditional comments and emits conditional token if
10836
10859
  * found. See also the related [[consumeConditional]] method.
10860
+ *
10861
+ * @internal
10837
10862
  */
10838
10863
  consumeComment(token) {
10839
10864
  const comment = token.data[0];
@@ -10848,6 +10873,8 @@ class Parser {
10848
10873
  }
10849
10874
  /**
10850
10875
  * Consumes doctype tokens. Emits doctype event.
10876
+ *
10877
+ * @internal
10851
10878
  */
10852
10879
  consumeDoctype(startToken, tokenStream) {
10853
10880
  const tokens = Array.from(this.consumeUntil(tokenStream, TokenType.DOCTYPE_CLOSE, startToken.location));
@@ -10865,6 +10892,7 @@ class Parser {
10865
10892
  /**
10866
10893
  * Return a list of tokens found until the expected token was found.
10867
10894
  *
10895
+ * @internal
10868
10896
  * @param errorLocation - What location to use if an error occurs
10869
10897
  */
10870
10898
  *consumeUntil(tokenStream, search, errorLocation) {
@@ -10929,6 +10957,7 @@ class Parser {
10929
10957
  /**
10930
10958
  * Defer execution. Will call function sometime later.
10931
10959
  *
10960
+ * @internal
10932
10961
  * @param cb - Callback to execute later.
10933
10962
  */
10934
10963
  defer(cb) {
@@ -11783,7 +11812,7 @@ class HtmlValidate {
11783
11812
  /** @public */
11784
11813
  const name = "html-validate";
11785
11814
  /** @public */
11786
- const version = "7.15.0";
11815
+ const version = "7.15.1";
11787
11816
  /** @public */
11788
11817
  const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
11789
11818