dsh-plugin-lookatstudy 0.22.1 → 0.23.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.
@@ -1,4 +1,4 @@
1
- import { n as readZipText, t as readZip } from "./zip-reader-KnRrq0av.mjs";
1
+ import { n as readZipText, t as readZip } from "./zip-reader-BakpZwuD.mjs";
2
2
  //#region src/vendor/docx-parser.ts
3
3
  function decodeEntities(s) {
4
4
  return s.replace(/<[^>]+>/g, "").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'").replace(/&amp;/g, "&");
@@ -1,5 +1,5 @@
1
- import { n as htmlToMarkdown } from "./html-article-Da8ksU0i.mjs";
2
- import { n as readZipText, t as readZip } from "./zip-reader-KnRrq0av.mjs";
1
+ import { n as htmlToMarkdown } from "./html-article-k4tDTqDh.mjs";
2
+ import { n as readZipText, t as readZip } from "./zip-reader-BakpZwuD.mjs";
3
3
  //#region src/vendor/epub-parser.ts
4
4
  /** 提取某标签的全部出现(OPF 的属性顺序不定,先抓整标签再逐个提属性)。 */
5
5
  function tags(xml, tagName) {
@@ -22,8 +22,12 @@ const ENTITIES = {
22
22
  };
23
23
  function decodeEntities(s) {
24
24
  return s.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (_m, ent) => {
25
- if (ent.startsWith("#x") || ent.startsWith("#X")) return String.fromCodePoint(parseInt(ent.slice(2), 16));
26
- if (ent.startsWith("#")) return String.fromCodePoint(parseInt(ent.slice(1), 10));
25
+ const codePoint = ent.startsWith("#x") || ent.startsWith("#X") ? parseInt(ent.slice(2), 16) : ent.startsWith("#") ? parseInt(ent.slice(1), 10) : NaN;
26
+ if (Number.isFinite(codePoint)) try {
27
+ return String.fromCodePoint(codePoint);
28
+ } catch {
29
+ return "�";
30
+ }
27
31
  return ENTITIES[ent.toLowerCase()] ?? _m;
28
32
  });
29
33
  }