html-react-parser 1.4.1 → 1.4.2

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.
@@ -1645,6 +1645,10 @@
1645
1645
  }
1646
1646
  Object.defineProperty(Node.prototype, "nodeType", {
1647
1647
  // Read-only aliases
1648
+ /**
1649
+ * [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
1650
+ * node {@link type}.
1651
+ */
1648
1652
  get: function () {
1649
1653
  var _a;
1650
1654
  return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1;
@@ -1654,6 +1658,10 @@
1654
1658
  });
1655
1659
  Object.defineProperty(Node.prototype, "parentNode", {
1656
1660
  // Read-write aliases for properties
1661
+ /**
1662
+ * Same as {@link parent}.
1663
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
1664
+ */
1657
1665
  get: function () {
1658
1666
  return this.parent;
1659
1667
  },
@@ -1664,6 +1672,10 @@
1664
1672
  configurable: true
1665
1673
  });
1666
1674
  Object.defineProperty(Node.prototype, "previousSibling", {
1675
+ /**
1676
+ * Same as {@link prev}.
1677
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
1678
+ */
1667
1679
  get: function () {
1668
1680
  return this.prev;
1669
1681
  },
@@ -1674,6 +1686,10 @@
1674
1686
  configurable: true
1675
1687
  });
1676
1688
  Object.defineProperty(Node.prototype, "nextSibling", {
1689
+ /**
1690
+ * Same as {@link next}.
1691
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
1692
+ */
1677
1693
  get: function () {
1678
1694
  return this.next;
1679
1695
  },
@@ -1711,6 +1727,10 @@
1711
1727
  return _this;
1712
1728
  }
1713
1729
  Object.defineProperty(DataNode.prototype, "nodeValue", {
1730
+ /**
1731
+ * Same as {@link data}.
1732
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
1733
+ */
1714
1734
  get: function () {
1715
1735
  return this.data;
1716
1736
  },
@@ -1774,6 +1794,7 @@
1774
1794
  }
1775
1795
  Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
1776
1796
  // Aliases
1797
+ /** First child of the node. */
1777
1798
  get: function () {
1778
1799
  var _a;
1779
1800
  return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
@@ -1782,6 +1803,7 @@
1782
1803
  configurable: true
1783
1804
  });
1784
1805
  Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
1806
+ /** Last child of the node. */
1785
1807
  get: function () {
1786
1808
  return this.children.length > 0
1787
1809
  ? this.children[this.children.length - 1]
@@ -1791,6 +1813,10 @@
1791
1813
  configurable: true
1792
1814
  });
1793
1815
  Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
1816
+ /**
1817
+ * Same as {@link children}.
1818
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
1819
+ */
1794
1820
  get: function () {
1795
1821
  return this.children;
1796
1822
  },
@@ -1838,6 +1864,10 @@
1838
1864
  }
1839
1865
  Object.defineProperty(Element.prototype, "tagName", {
1840
1866
  // DOM Level 1 aliases
1867
+ /**
1868
+ * Same as {@link name}.
1869
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
1870
+ */
1841
1871
  get: function () {
1842
1872
  return this.name;
1843
1873
  },
@@ -1941,6 +1971,9 @@
1941
1971
  var children = recursive ? cloneChildren(node.children) : [];
1942
1972
  var clone_1 = new Element$1(node.name, __assign({}, node.attribs), children);
1943
1973
  children.forEach(function (child) { return (child.parent = clone_1); });
1974
+ if (node.namespace != null) {
1975
+ clone_1.namespace = node.namespace;
1976
+ }
1944
1977
  if (node["x-attribsNamespace"]) {
1945
1978
  clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
1946
1979
  }
@@ -1974,10 +2007,13 @@
1974
2007
  result = instruction;
1975
2008
  }
1976
2009
  else {
1977
- throw new Error("Not implemented yet: " + node.type);
2010
+ throw new Error("Not implemented yet: ".concat(node.type));
1978
2011
  }
1979
2012
  result.startIndex = node.startIndex;
1980
2013
  result.endIndex = node.endIndex;
2014
+ if (node.sourceCodeLocation != null) {
2015
+ result.sourceCodeLocation = node.sourceCodeLocation;
2016
+ }
1981
2017
  return result;
1982
2018
  }
1983
2019
  node.cloneNode = cloneNode;