markdown-codec 6.7.4 → 6.7.5

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.
Files changed (56) hide show
  1. package/README.md +2 -1
  2. package/dist/block/definitions.cjs +1 -5
  3. package/dist/block/definitions.js +1 -5
  4. package/dist/block/line.cjs +2 -2
  5. package/dist/block/line.js +2 -2
  6. package/dist/block/list.cjs +7 -14
  7. package/dist/block/list.js +7 -14
  8. package/dist/block/table.cjs +3 -4
  9. package/dist/block/table.js +3 -4
  10. package/dist/codec.d.cts +9 -9
  11. package/dist/codec.d.ts +9 -9
  12. package/dist/emit/emit.cjs +35 -37
  13. package/dist/emit/emit.js +35 -37
  14. package/dist/emit/table.cjs +2 -2
  15. package/dist/emit/table.js +2 -2
  16. package/dist/html/html.cjs +0 -2
  17. package/dist/html/html.js +0 -2
  18. package/dist/html/render.cjs +3 -11
  19. package/dist/html/render.js +3 -11
  20. package/dist/image/image.cjs +0 -49
  21. package/dist/image/image.d.cts +2 -2
  22. package/dist/image/image.d.ts +2 -2
  23. package/dist/image/image.js +1 -48
  24. package/dist/{image-BtmTG4_a.d.cts → image-83yql5ES.d.cts} +1 -3
  25. package/dist/{image-BtmTG4_a.d.ts → image-83yql5ES.d.ts} +1 -3
  26. package/dist/{image-B5L0HpAJ.d.cts → image-B6p0Ovgy.d.cts} +1 -1
  27. package/dist/{image-C390OIB3.d.ts → image-gR1vISI0.d.ts} +1 -1
  28. package/dist/index.d.cts +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/inline/chars.cjs +3 -6
  31. package/dist/inline/chars.js +3 -6
  32. package/dist/inline/delimiter.cjs +5 -12
  33. package/dist/inline/delimiter.d.cts +2 -1
  34. package/dist/inline/delimiter.d.ts +2 -1
  35. package/dist/inline/delimiter.js +5 -13
  36. package/dist/inline/entity.cjs +6 -10
  37. package/dist/inline/entity.js +6 -10
  38. package/dist/inline/link.cjs +4 -5
  39. package/dist/inline/link.js +4 -5
  40. package/dist/lower/front-matter.cjs +4 -8
  41. package/dist/lower/front-matter.js +4 -8
  42. package/dist/lower/image.cjs +3 -2
  43. package/dist/lower/image.d.cts +1 -1
  44. package/dist/lower/image.d.ts +1 -1
  45. package/dist/lower/image.js +2 -1
  46. package/dist/lower/inline.cjs +0 -2
  47. package/dist/lower/inline.js +0 -2
  48. package/dist/options/options.d.cts +1 -1
  49. package/dist/options/options.d.ts +1 -1
  50. package/dist/read.cjs +2 -2
  51. package/dist/read.js +2 -2
  52. package/dist/scan/scan.cjs +1 -3
  53. package/dist/scan/scan.js +1 -3
  54. package/dist/shared/list-id.cjs +1 -1
  55. package/dist/shared/list-id.js +1 -1
  56. package/package.json +2 -1
@@ -1,5 +1,5 @@
1
1
  import { i as MarkdownDiagnosticSink } from "../diagnostics-CjfBoW4K.cjs";
2
- import { n as MarkdownImageResolver } from "../image-B5L0HpAJ.cjs";
2
+ import { n as MarkdownImageResolver } from "../image-B6p0Ovgy.cjs";
3
3
  import { Margins, PageSize } from "document-schema.js";
4
4
  //#region src/options/options.d.ts
5
5
  interface ReadMarkdownOptions {
@@ -1,5 +1,5 @@
1
1
  import { i as MarkdownDiagnosticSink } from "../diagnostics-CjfBoW4K.js";
2
- import { n as MarkdownImageResolver } from "../image-C390OIB3.js";
2
+ import { n as MarkdownImageResolver } from "../image-gR1vISI0.js";
3
3
  import { Margins, PageSize } from "document-schema.js";
4
4
  //#region src/options/options.d.ts
5
5
  interface ReadMarkdownOptions {
package/dist/read.cjs CHANGED
@@ -39,14 +39,14 @@ function readMarkdown(text, options = {}) {
39
39
  xml: detail.frontMatterSource
40
40
  };
41
41
  return {
42
- documentPackage: definitions === void 0 && frontMatterResidue === void 0 ? assembled : {
42
+ documentPackage: {
43
43
  ...assembled,
44
44
  ...definitions !== void 0 ? { definitions: {
45
45
  ...assembled.definitions,
46
46
  ...definitions
47
47
  } } : {},
48
48
  ...frontMatterResidue !== void 0 ? { source: {
49
- ...assembled.source ?? {},
49
+ ...assembled.source,
50
50
  frontmatter: frontMatterResidue
51
51
  } } : {}
52
52
  },
package/dist/read.js CHANGED
@@ -38,14 +38,14 @@ function readMarkdown(text, options = {}) {
38
38
  xml: detail.frontMatterSource
39
39
  };
40
40
  return {
41
- documentPackage: definitions === void 0 && frontMatterResidue === void 0 ? assembled : {
41
+ documentPackage: {
42
42
  ...assembled,
43
43
  ...definitions !== void 0 ? { definitions: {
44
44
  ...assembled.definitions,
45
45
  ...definitions
46
46
  } } : {},
47
47
  ...frontMatterResidue !== void 0 ? { source: {
48
- ...assembled.source ?? {},
48
+ ...assembled.source,
49
49
  frontmatter: frontMatterResidue
50
50
  } } : {}
51
51
  },
@@ -18,11 +18,9 @@ var MarkdownScanCursor = class {
18
18
  };
19
19
  }
20
20
  atEnd() {
21
- return this.pendingTabColumns === 0 && this.rawOffset >= this.source.length;
21
+ return this.rawOffset >= this.source.length;
22
22
  }
23
23
  peek() {
24
- if (this.pendingTabColumns > 0) return " ";
25
- if (this.rawOffset >= this.source.length) return;
26
24
  const char = this.source[this.rawOffset];
27
25
  if (char === " ") return " ";
28
26
  if (char === "\r") return "\n";
package/dist/scan/scan.js CHANGED
@@ -17,11 +17,9 @@ var MarkdownScanCursor = class {
17
17
  };
18
18
  }
19
19
  atEnd() {
20
- return this.pendingTabColumns === 0 && this.rawOffset >= this.source.length;
20
+ return this.rawOffset >= this.source.length;
21
21
  }
22
22
  peek() {
23
- if (this.pendingTabColumns > 0) return " ";
24
- if (this.rawOffset >= this.source.length) return;
25
23
  const char = this.source[this.rawOffset];
26
24
  if (char === " ") return " ";
27
25
  if (char === "\r") return "\n";
@@ -18,7 +18,7 @@ function parseListNumId(numId) {
18
18
  const match = NUMID_PATTERN.exec(numId);
19
19
  if (match === null) return;
20
20
  const type = match[2];
21
- if (type === void 0 || type !== "bullet" && type !== "ordered") return;
21
+ if (type !== "bullet" && type !== "ordered") return;
22
22
  const startText = match[3];
23
23
  return {
24
24
  type,
@@ -17,7 +17,7 @@ function parseListNumId(numId) {
17
17
  const match = NUMID_PATTERN.exec(numId);
18
18
  if (match === null) return;
19
19
  const type = match[2];
20
- if (type === void 0 || type !== "bullet" && type !== "ordered") return;
20
+ if (type !== "bullet" && type !== "ordered") return;
21
21
  const startText = match[3];
22
22
  return {
23
23
  type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-codec",
3
- "version": "6.7.4",
3
+ "version": "6.7.5",
4
4
  "description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
5
5
  "type": "module",
6
6
  "repository": {
@@ -83,6 +83,7 @@
83
83
  "license": "MIT",
84
84
  "packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
85
85
  "dependencies": {
86
+ "byte-codec": "1.6.1",
86
87
  "document-schema.js": "7.11.4",
87
88
  "zod": "4.4.3"
88
89
  },