MpHtmlParser.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. // 小程序富文本插件 https://github.com/jin-yufeng/Parser
  2. "use strict";
  3. function _classCallCheck(t, i) {
  4. if (!(t instanceof i))
  5. throw new TypeError("Cannot call a class as a function");
  6. }
  7. var _createClass = (function () {
  8. function t(t, i) {
  9. for (var s = 0; s < i.length; s++) {
  10. var e = i[s];
  11. (e.enumerable = e.enumerable || !1),
  12. (e.configurable = !0),
  13. "value" in e && (e.writable = !0),
  14. Object.defineProperty(t, e.key, e);
  15. }
  16. }
  17. return function (i, s, e) {
  18. return s && t(i.prototype, s), e && t(i, e), i;
  19. };
  20. })(),
  21. cfg = require("./config.js"),
  22. blankChar = cfg.blankChar,
  23. CssHandler = require("./CssHandler.js"),
  24. screenWidth = wx.getSystemInfoSync().screenWidth;
  25. try {
  26. var emoji = require("./emoji.js.js.js");
  27. } catch (t) {}
  28. var MpHtmlParser = (function () {
  29. function t(i) {
  30. var s = this,
  31. e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
  32. _classCallCheck(this, t),
  33. (this.getName = function (t) {
  34. return s.xml ? t : t.toLowerCase();
  35. }),
  36. (this.isClose = function () {
  37. return (
  38. ">" == s.data[s.i] || ("/" == s.data[s.i] && ">" == s.data[s.i + 1])
  39. );
  40. }),
  41. (this.section = function () {
  42. return s.data.substring(s.start, s.i);
  43. }),
  44. (this.parent = function () {
  45. return s.STACK[s.STACK.length - 1];
  46. }),
  47. (this.siblings = function () {
  48. return s.STACK.length ? s.parent().children : s.DOM;
  49. }),
  50. (this.attrs = {}),
  51. (this.compress = e.compress),
  52. (this.CssHandler = new CssHandler(e.tagStyle, screenWidth)),
  53. (this.data = i),
  54. (this.domain = e.domain),
  55. (this.DOM = []),
  56. (this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0),
  57. (this.protocol =
  58. this.domain && this.domain.includes("://")
  59. ? this.domain.split("://")[0]
  60. : "http"),
  61. (this.state = this.Text),
  62. (this.STACK = []),
  63. (this.useAnchor = e.useAnchor),
  64. (this.xml = e.xml);
  65. }
  66. return (
  67. _createClass(t, [
  68. {
  69. key: "parse",
  70. value: function () {
  71. emoji && (this.data = emoji.parseEmoji(this.data));
  72. for (var t; (t = this.data[this.i]); this.i++) this.state(t);
  73. for (this.state == this.Text && this.setText(); this.STACK.length; )
  74. this.popNode(this.STACK.pop());
  75. return (
  76. this.DOM.length &&
  77. ((this.DOM[0].PoweredBy = "Parser"),
  78. this.title && (this.DOM[0].title = this.title)),
  79. this.DOM
  80. );
  81. },
  82. },
  83. {
  84. key: "setAttr",
  85. value: function () {
  86. var t = this.getName(this.attrName);
  87. for (
  88. cfg.trustAttrs[t] &&
  89. (this.attrVal
  90. ? (this.attrs[t] =
  91. "src" == t
  92. ? this.getUrl(this.attrVal.replace(/&amp;/g, "&"))
  93. : this.attrVal)
  94. : cfg.boolAttrs[t] && (this.attrs[t] = "T")),
  95. this.attrVal = "";
  96. blankChar[this.data[this.i]];
  97. )
  98. this.i++;
  99. this.isClose()
  100. ? this.setNode()
  101. : ((this.start = this.i), (this.state = this.AttrName));
  102. },
  103. },
  104. {
  105. key: "setText",
  106. value: function () {
  107. var t,
  108. i = this.section();
  109. if (i)
  110. if (
  111. ((i =
  112. (cfg.onText &&
  113. cfg.onText(i, function () {
  114. return (t = !0);
  115. })) ||
  116. i),
  117. t)
  118. ) {
  119. this.data =
  120. this.data.substr(0, this.start) + i + this.data.substr(this.i);
  121. var s = this.start + i.length;
  122. for (this.i = this.start; this.i < s; this.i++)
  123. this.state(this.data[this.i]);
  124. } else {
  125. if (!this.pre) {
  126. for (var e, a = [], r = i.length; (e = i[--r]); )
  127. (!blankChar[e] || (!blankChar[a[0]] && (e = " "))) &&
  128. a.unshift(e);
  129. if (" " == (i = a.join(""))) return;
  130. }
  131. for (var h, n, l = -1, o = this.siblings(); ; ) {
  132. if (-1 == (l = i.indexOf("&", l + 1))) break;
  133. if (-1 == (h = i.indexOf(";", l + 2))) break;
  134. "#" == i[l + 1]
  135. ? ((n = parseInt(
  136. ("x" == i[l + 2] ? "0" : "") + i.substring(l + 2, h)
  137. )),
  138. isNaN(n) ||
  139. (i =
  140. i.substr(0, l) +
  141. String.fromCharCode(n) +
  142. i.substr(h + 1)))
  143. : ((n = i.substring(l + 1, h)),
  144. "nbsp" == n
  145. ? (i = i.substr(0, l) + " " + i.substr(h + 1))
  146. : "lt" != n &&
  147. "gt" != n &&
  148. "amp" != n &&
  149. "ensp" != n &&
  150. "emsp" != n &&
  151. "quot" != n &&
  152. "apos" != n &&
  153. (l && o.push({ type: "text", text: i.substr(0, l) }),
  154. o.push({ type: "text", text: "&" + n + ";", en: 1 }),
  155. (i = i.substr(h + 1)),
  156. (l = -1)));
  157. }
  158. i && o.push({ type: "text", text: i });
  159. }
  160. },
  161. },
  162. {
  163. key: "setNode",
  164. value: function () {
  165. var t = { name: this.getName(this.tagName), attrs: this.attrs },
  166. i =
  167. cfg.selfClosingTags[t.name] ||
  168. (this.xml && "/" == this.data[this.i]);
  169. if (((this.attrs = {}), cfg.ignoreTags[t.name]))
  170. if (i)
  171. if ("source" == t.name) {
  172. var s = this.parent(),
  173. e = t.attrs;
  174. if (s && e.src)
  175. if ("video" == s.name || "audio" == s.name)
  176. s.attrs.source.push(e.src);
  177. else {
  178. var a,
  179. r = e.media;
  180. "picture" == s.name &&
  181. !s.attrs.src &&
  182. (!r ||
  183. (r.includes("px") &&
  184. ((-1 != (a = r.indexOf("min-width")) &&
  185. -1 != (a = r.indexOf(":", a + 8)) &&
  186. screenWidth > parseInt(r.substr(a + 1))) ||
  187. (-1 != (a = r.indexOf("max-width")) &&
  188. -1 != (a = r.indexOf(":", a + 8)) &&
  189. screenWidth < parseInt(r.substr(a + 1)))))) &&
  190. (s.attrs.src = e.src);
  191. }
  192. } else
  193. "base" != t.name || this.domain || (this.domain = t.attrs.href);
  194. else this.remove(t);
  195. else
  196. this.matchAttr(t),
  197. i
  198. ? (cfg.filter && 0 == cfg.filter(t, this)) ||
  199. this.siblings().push(t)
  200. : ((t.children = []),
  201. "pre" == t.name &&
  202. cfg.highlight &&
  203. (this.remove(t), (this.pre = t.pre = !0)),
  204. this.siblings().push(t),
  205. this.STACK.push(t));
  206. "/" == this.data[this.i] && this.i++,
  207. (this.start = this.i + 1),
  208. (this.state = this.Text);
  209. },
  210. },
  211. {
  212. key: "remove",
  213. value: function (t) {
  214. for (var i = t.name, s = this.i; ; ) {
  215. if (-1 == (this.i = this.data.indexOf("</", this.i + 1)))
  216. return void (this.i =
  217. "pre" == i || "svg" == i ? s : this.data.length);
  218. for (
  219. this.start = this.i += 2;
  220. !blankChar[this.data[this.i]] && !this.isClose();
  221. )
  222. this.i++;
  223. if (this.getName(this.section()) == i) {
  224. if ("pre" == i)
  225. return (
  226. (this.data =
  227. this.data.substr(0, s + 1) +
  228. cfg.highlight(
  229. this.data.substring(s + 1, this.i - 5),
  230. t.attrs
  231. ) +
  232. this.data.substr(this.i - 5)),
  233. (this.i = s)
  234. );
  235. if (
  236. ("style" == i
  237. ? this.CssHandler.getStyle(
  238. this.data.substring(s + 1, this.i - 7)
  239. )
  240. : "title" == i &&
  241. (this.title = this.data.substring(s + 1, this.i - 7)),
  242. -1 == (this.i = this.data.indexOf(">", this.i)) &&
  243. (this.i = this.data.length),
  244. "svg" == i)
  245. ) {
  246. var e = this.data.substring(s, this.i + 1);
  247. t.attrs.xmlns ||
  248. (e = ' xmlns="http://www.w3.org/2000/svg"' + e);
  249. for (var a = s; "<" != this.data[s]; ) s--;
  250. e = this.data.substring(s, a) + e;
  251. var r = this.parent();
  252. "100%" == t.attrs.width &&
  253. r &&
  254. (r.attrs.style || "").includes("inline") &&
  255. (r.attrs.style =
  256. "width:300px;max-width:100%;" + r.attrs.style),
  257. this.siblings().push({
  258. name: "img",
  259. attrs: {
  260. src: "data:image/svg+xml;utf8," + e.replace(/#/g, "%23"),
  261. },
  262. svg: 1,
  263. });
  264. }
  265. return;
  266. }
  267. }
  268. },
  269. },
  270. {
  271. key: "matchAttr",
  272. value: function (t) {
  273. var i = t.attrs,
  274. s = this.CssHandler.match(t.name, i, t) + (i.style || ""),
  275. e = {};
  276. switch (
  277. (i.id &&
  278. (1 & this.compress
  279. ? (i.id = void 0)
  280. : this.useAnchor && this.bubble()),
  281. 2 & this.compress && i.class && (i.class = void 0),
  282. t.name)
  283. ) {
  284. case "a":
  285. case "ad":
  286. this.bubble();
  287. break;
  288. case "font":
  289. if (
  290. (i.color && ((e.color = i.color), (i.color = void 0)),
  291. i.face && ((e["font-family"] = i.face), (i.face = void 0)),
  292. i.size)
  293. ) {
  294. var a = parseInt(i.size);
  295. a < 1 ? (a = 1) : a > 7 && (a = 7);
  296. var r = [
  297. "xx-small",
  298. "x-small",
  299. "small",
  300. "medium",
  301. "large",
  302. "x-large",
  303. "xx-large",
  304. ];
  305. (e["font-size"] = r[a - 1]), (i.size = void 0);
  306. }
  307. break;
  308. case "video":
  309. case "audio":
  310. i.id
  311. ? this[t.name + "Num"]++
  312. : (i.id = t.name + ++this[t.name + "Num"]),
  313. "video" == t.name && this.videoNum > 3 && (t.lazyLoad = 1),
  314. (i.source = []),
  315. i.src && i.source.push(i.src),
  316. i.controls ||
  317. i.autoplay ||
  318. console.warn(
  319. "存在没有 controls 属性的 " +
  320. t.name +
  321. " 标签,可能导致无法播放",
  322. t
  323. ),
  324. this.bubble();
  325. break;
  326. case "td":
  327. case "th":
  328. if (i.colspan || i.rowspan)
  329. for (var h, n = this.STACK.length; (h = this.STACK[--n]); )
  330. if ("table" == h.name) {
  331. h.c = void 0;
  332. break;
  333. }
  334. }
  335. i.align && ((e["text-align"] = i.align), (i.align = void 0)),
  336. i.width &&
  337. ((e.width =
  338. parseFloat(i.width) + (i.width.includes("%") ? "%" : "px")),
  339. (i.width = void 0)),
  340. i.height &&
  341. ((e.height =
  342. parseFloat(i.height) + (i.height.includes("%") ? "%" : "px")),
  343. (i.height = void 0));
  344. var l = s
  345. .replace(/&quot;/g, '"')
  346. .replace(/&amp;/g, "&")
  347. .split(";");
  348. s = "";
  349. for (var o = 0, c = l.length; o < c; o++) {
  350. var d = l[o].split(":");
  351. if (!(d.length < 2)) {
  352. var u = d[0].trim().toLowerCase(),
  353. f = d.slice(1).join(":").trim();
  354. f.includes("-webkit") ||
  355. f.includes("-moz") ||
  356. f.includes("-ms") ||
  357. f.includes("-o") ||
  358. f.includes("safe")
  359. ? (s += ";" + u + ":" + f)
  360. : (e[u] && !f.includes("import") && e[u].includes("import")) ||
  361. (e[u] = f);
  362. }
  363. }
  364. if ("img" == t.name || "picture" == t.name) {
  365. i["data-src"] &&
  366. ((i.src = i.src || i["data-src"]), (i["data-src"] = void 0)),
  367. (!i.src && "picture" != t.name) ||
  368. i.ignore ||
  369. (this.bubble()
  370. ? ((i.src || "").includes(".webp") && (t.webp = 1),
  371. (i.i = (this.imgNum++).toString()))
  372. : (i.ignore = "T")),
  373. i.ignore && (e["max-width"] = "100%");
  374. var m = function (t) {
  375. return e[t] && !e[t].includes("auto");
  376. };
  377. if (m("width")) {
  378. var g = this.parent();
  379. e.width.includes("%") &&
  380. g &&
  381. (g.attrs.style || "").includes("inline") &&
  382. ((g.attrs.style += ";max-width:100%"), (t.auto = 1)),
  383. parseInt(e.width) > screenWidth && (e.height = "auto"),
  384. m("height") && (t.mode = "scaleToFill");
  385. } else m("height") ? (t.mode = "heightFix") : (t.auto = 1);
  386. }
  387. for (var p in e) {
  388. var b = e[p];
  389. if (
  390. ((p.includes("flex") || "order" == p || "self-align" == p) &&
  391. (t.c = 1),
  392. b.includes("url"))
  393. ) {
  394. var v = b.indexOf("(");
  395. if (-1 != v++) {
  396. for (; '"' == b[v] || "'" == b[v] || blankChar[b[v]]; ) v++;
  397. b = b.substr(0, v) + this.getUrl(b.substr(v));
  398. }
  399. } else
  400. b.includes("rpx")
  401. ? (b = b.replace(/[0-9.]+\s*rpx/g, function (t) {
  402. return (parseFloat(t) * screenWidth) / 750 + "px";
  403. }))
  404. : "white-space" == p &&
  405. b.includes("pre") &&
  406. (this.pre = t.pre = !0);
  407. s += ";" + p + ":" + b;
  408. }
  409. (s = s.substr(1)) && (i.style = s);
  410. },
  411. },
  412. {
  413. key: "popNode",
  414. value: function (t) {
  415. if (t.pre) {
  416. t.pre = this.pre = void 0;
  417. for (var i = this.STACK.length; i--; )
  418. this.STACK[i].pre && (this.pre = !0);
  419. }
  420. if ("head" == t.name || (cfg.filter && 0 == cfg.filter(t, this)))
  421. return this.siblings().pop();
  422. var s = t.attrs;
  423. if ("picture" == t.name)
  424. return (
  425. (t.name = "img"),
  426. s.src ||
  427. "img" != (t.children[0] || "").name ||
  428. (s.src = t.children[0].attrs.src),
  429. (t.children = void 0)
  430. );
  431. if (
  432. (cfg.blockTags[t.name]
  433. ? (t.name = "div")
  434. : cfg.trustTags[t.name] || (t.name = "span"),
  435. t.c)
  436. )
  437. if ("ul" == t.name) {
  438. for (var e = 1, a = this.STACK.length; a--; )
  439. "ul" == this.STACK[a].name && e++;
  440. if (1 != e)
  441. for (var r = t.children.length; r--; ) t.children[r].floor = e;
  442. } else if ("ol" == t.name)
  443. for (var h, n = 0, l = 1; (h = t.children[n++]); )
  444. "li" == h.name &&
  445. ((h.type = "ol"),
  446. (h.num =
  447. (function (t, i) {
  448. if ("a" == i)
  449. return String.fromCharCode(97 + ((t - 1) % 26));
  450. if ("A" == i)
  451. return String.fromCharCode(65 + ((t - 1) % 26));
  452. if ("i" == i || "I" == i) {
  453. t = ((t - 1) % 99) + 1;
  454. var s = [
  455. "I",
  456. "II",
  457. "III",
  458. "IV",
  459. "V",
  460. "VI",
  461. "VII",
  462. "VIII",
  463. "IX",
  464. ],
  465. e = [
  466. "X",
  467. "XX",
  468. "XXX",
  469. "XL",
  470. "L",
  471. "LX",
  472. "LXX",
  473. "LXXX",
  474. "XC",
  475. ],
  476. a =
  477. (e[Math.floor(t / 10) - 1] || "") +
  478. (s[(t % 10) - 1] || "");
  479. return "i" == i ? a.toLowerCase() : a;
  480. }
  481. return t;
  482. })(l++, s.type) + "."));
  483. if ("table" == t.name) {
  484. var o = s.cellpadding,
  485. c = s.cellspacing,
  486. d = s.border;
  487. t.c &&
  488. (this.bubble(),
  489. (s.style = (s.style || "") + ";display:table"),
  490. o || (o = 2),
  491. c || (c = 2)),
  492. d &&
  493. (s.style = "border:" + d + "px solid gray;" + (s.style || "")),
  494. c && (s.style = "border-spacing:" + c + "px;" + (s.style || "")),
  495. (d || o || t.c) &&
  496. (function i(s) {
  497. for (var e, a = 0; (e = s[a]); a++) {
  498. var r = e.attrs.style || "";
  499. t.c &&
  500. "t" == e.name[0] &&
  501. ((e.c = 1),
  502. (r +=
  503. ";display:table-" +
  504. ("th" == e.name || "td" == e.name
  505. ? "cell"
  506. : "tr" == e.name
  507. ? "row"
  508. : "row-group"))),
  509. "th" == e.name || "td" == e.name
  510. ? (d && (r = "border:" + d + "px solid gray;" + r),
  511. o && (r = "padding:" + o + "px;" + r))
  512. : i(e.children || []),
  513. r && (e.attrs.style = r);
  514. }
  515. })(t.children);
  516. }
  517. if (
  518. (this.CssHandler.pop && this.CssHandler.pop(t),
  519. "div" == t.name && !Object.keys(s).length)
  520. ) {
  521. var u = this.siblings();
  522. 1 == t.children.length &&
  523. "div" == t.children[0].name &&
  524. (u[u.length - 1] = t.children[0]);
  525. }
  526. },
  527. },
  528. {
  529. key: "bubble",
  530. value: function () {
  531. for (var t, i = this.STACK.length; (t = this.STACK[--i]); ) {
  532. if (cfg.richOnlyTags[t.name])
  533. return (
  534. "table" != t.name ||
  535. Object.hasOwnProperty.call(t, "c") ||
  536. (t.c = 1),
  537. !1
  538. );
  539. t.c = 1;
  540. }
  541. return !0;
  542. },
  543. },
  544. {
  545. key: "getUrl",
  546. value: function (t) {
  547. return (
  548. "/" == t[0]
  549. ? "/" == t[1]
  550. ? (t = this.protocol + ":" + t)
  551. : this.domain && (t = this.domain + t)
  552. : this.domain &&
  553. 0 != t.indexOf("data:") &&
  554. !t.includes("://") &&
  555. (t = this.domain + "/" + t),
  556. t
  557. );
  558. },
  559. },
  560. {
  561. key: "Text",
  562. value: function (t) {
  563. if ("<" == t) {
  564. var i = this.data[this.i + 1],
  565. s = function (t) {
  566. return (t >= "a" && t <= "z") || (t >= "A" && t <= "Z");
  567. };
  568. s(i)
  569. ? (this.setText(),
  570. (this.start = this.i + 1),
  571. (this.state = this.TagName))
  572. : "/" == i
  573. ? (this.setText(),
  574. s(this.data[++this.i + 1])
  575. ? ((this.start = this.i + 1), (this.state = this.EndTag))
  576. : this.Comment())
  577. : "!" == i && (this.setText(), this.Comment());
  578. }
  579. },
  580. },
  581. {
  582. key: "Comment",
  583. value: function () {
  584. var t;
  585. (t =
  586. "--" == this.data.substring(this.i + 2, this.i + 4)
  587. ? "--\x3e"
  588. : "[CDATA[" == this.data.substring(this.i + 2, this.i + 9)
  589. ? "]]>"
  590. : ">"),
  591. -1 == (this.i = this.data.indexOf(t, this.i + 2))
  592. ? (this.i = this.data.length)
  593. : (this.i += t.length - 1),
  594. (this.start = this.i + 1),
  595. (this.state = this.Text);
  596. },
  597. },
  598. {
  599. key: "TagName",
  600. value: function (t) {
  601. if (blankChar[t]) {
  602. for (this.tagName = this.section(); blankChar[this.data[this.i]]; )
  603. this.i++;
  604. this.isClose()
  605. ? this.setNode()
  606. : ((this.start = this.i), (this.state = this.AttrName));
  607. } else
  608. this.isClose() && ((this.tagName = this.section()), this.setNode());
  609. },
  610. },
  611. {
  612. key: "AttrName",
  613. value: function (t) {
  614. var i = blankChar[t];
  615. if (
  616. (i && ((this.attrName = this.section()), (t = this.data[this.i])),
  617. "=" == t)
  618. ) {
  619. for (
  620. i || (this.attrName = this.section());
  621. blankChar[this.data[++this.i]];
  622. );
  623. (this.start = this.i--), (this.state = this.AttrValue);
  624. } else
  625. i
  626. ? this.setAttr()
  627. : this.isClose() &&
  628. ((this.attrName = this.section()), this.setAttr());
  629. },
  630. },
  631. {
  632. key: "AttrValue",
  633. value: function (t) {
  634. if ('"' == t || "'" == t) {
  635. if (
  636. (this.start++, -1 == (this.i = this.data.indexOf(t, this.i + 1)))
  637. )
  638. return (this.i = this.data.length);
  639. (this.attrVal = this.section()), this.i++;
  640. } else {
  641. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++);
  642. this.attrVal = this.section();
  643. }
  644. this.setAttr();
  645. },
  646. },
  647. {
  648. key: "EndTag",
  649. value: function (t) {
  650. if (blankChar[t] || ">" == t || "/" == t) {
  651. for (
  652. var i = this.getName(this.section()), s = this.STACK.length;
  653. s-- && this.STACK[s].name != i;
  654. );
  655. if (-1 != s) {
  656. for (var e; (e = this.STACK.pop()).name != i; );
  657. this.popNode(e);
  658. } else
  659. ("p" != i && "br" != i) ||
  660. this.siblings().push({ name: i, attrs: {} });
  661. (this.i = this.data.indexOf(">", this.i)),
  662. (this.start = this.i + 1),
  663. -1 == this.i
  664. ? (this.i = this.data.length)
  665. : (this.state = this.Text);
  666. }
  667. },
  668. },
  669. ]),
  670. t
  671. );
  672. })();
  673. module.exports = MpHtmlParser;