markdown-codec 11.1.11 → 11.1.13

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/codec.d.cts CHANGED
@@ -17,8 +17,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
17
17
  paragraph: z.ZodOptional<z.ZodObject<{
18
18
  alignment: z.ZodOptional<z.ZodEnum<{
19
19
  left: "left";
20
- right: "right";
21
20
  center: "center";
21
+ right: "right";
22
22
  justify: "justify";
23
23
  }>>;
24
24
  list: z.ZodOptional<z.ZodObject<{
@@ -172,8 +172,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
172
172
  paragraph: z.ZodOptional<z.ZodObject<{
173
173
  alignment: z.ZodOptional<z.ZodEnum<{
174
174
  left: "left";
175
- right: "right";
176
175
  center: "center";
176
+ right: "right";
177
177
  justify: "justify";
178
178
  }>>;
179
179
  list: z.ZodOptional<z.ZodObject<{
@@ -332,8 +332,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
332
332
  paragraph: z.ZodOptional<z.ZodObject<{
333
333
  alignment: z.ZodOptional<z.ZodEnum<{
334
334
  left: "left";
335
- right: "right";
336
335
  center: "center";
336
+ right: "right";
337
337
  justify: "justify";
338
338
  }>>;
339
339
  list: z.ZodOptional<z.ZodObject<{
@@ -487,8 +487,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
487
487
  paragraph: z.ZodOptional<z.ZodObject<{
488
488
  alignment: z.ZodOptional<z.ZodEnum<{
489
489
  left: "left";
490
- right: "right";
491
490
  center: "center";
491
+ right: "right";
492
492
  justify: "justify";
493
493
  }>>;
494
494
  list: z.ZodOptional<z.ZodObject<{
@@ -701,8 +701,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
701
701
  paragraph: z.ZodOptional<z.ZodObject<{
702
702
  alignment: z.ZodOptional<z.ZodEnum<{
703
703
  left: "left";
704
- right: "right";
705
704
  center: "center";
705
+ right: "right";
706
706
  justify: "justify";
707
707
  }>>;
708
708
  list: z.ZodOptional<z.ZodObject<{
@@ -1538,8 +1538,8 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
1538
1538
  }, z.core.$strip>>;
1539
1539
  alignment: z.ZodOptional<z.ZodEnum<{
1540
1540
  left: "left";
1541
- right: "right";
1542
1541
  center: "center";
1542
+ right: "right";
1543
1543
  justify: "justify";
1544
1544
  }>>;
1545
1545
  verticalAlignment: z.ZodOptional<z.ZodEnum<{
@@ -1681,10 +1681,10 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
1681
1681
  }>;
1682
1682
  align: z.ZodEnum<{
1683
1683
  left: "left";
1684
+ center: "center";
1684
1685
  right: "right";
1685
1686
  top: "top";
1686
1687
  bottom: "bottom";
1687
- center: "center";
1688
1688
  inside: "inside";
1689
1689
  outside: "outside";
1690
1690
  }>;
@@ -1724,10 +1724,10 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
1724
1724
  }>;
1725
1725
  align: z.ZodEnum<{
1726
1726
  left: "left";
1727
+ center: "center";
1727
1728
  right: "right";
1728
1729
  top: "top";
1729
1730
  bottom: "bottom";
1730
- center: "center";
1731
1731
  inside: "inside";
1732
1732
  outside: "outside";
1733
1733
  }>;
package/dist/codec.d.ts CHANGED
@@ -17,8 +17,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
17
17
  paragraph: z.ZodOptional<z.ZodObject<{
18
18
  alignment: z.ZodOptional<z.ZodEnum<{
19
19
  left: "left";
20
- right: "right";
21
20
  center: "center";
21
+ right: "right";
22
22
  justify: "justify";
23
23
  }>>;
24
24
  list: z.ZodOptional<z.ZodObject<{
@@ -172,8 +172,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
172
172
  paragraph: z.ZodOptional<z.ZodObject<{
173
173
  alignment: z.ZodOptional<z.ZodEnum<{
174
174
  left: "left";
175
- right: "right";
176
175
  center: "center";
176
+ right: "right";
177
177
  justify: "justify";
178
178
  }>>;
179
179
  list: z.ZodOptional<z.ZodObject<{
@@ -332,8 +332,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
332
332
  paragraph: z.ZodOptional<z.ZodObject<{
333
333
  alignment: z.ZodOptional<z.ZodEnum<{
334
334
  left: "left";
335
- right: "right";
336
335
  center: "center";
336
+ right: "right";
337
337
  justify: "justify";
338
338
  }>>;
339
339
  list: z.ZodOptional<z.ZodObject<{
@@ -487,8 +487,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
487
487
  paragraph: z.ZodOptional<z.ZodObject<{
488
488
  alignment: z.ZodOptional<z.ZodEnum<{
489
489
  left: "left";
490
- right: "right";
491
490
  center: "center";
491
+ right: "right";
492
492
  justify: "justify";
493
493
  }>>;
494
494
  list: z.ZodOptional<z.ZodObject<{
@@ -701,8 +701,8 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
701
701
  paragraph: z.ZodOptional<z.ZodObject<{
702
702
  alignment: z.ZodOptional<z.ZodEnum<{
703
703
  left: "left";
704
- right: "right";
705
704
  center: "center";
705
+ right: "right";
706
706
  justify: "justify";
707
707
  }>>;
708
708
  list: z.ZodOptional<z.ZodObject<{
@@ -1538,8 +1538,8 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
1538
1538
  }, z.core.$strip>>;
1539
1539
  alignment: z.ZodOptional<z.ZodEnum<{
1540
1540
  left: "left";
1541
- right: "right";
1542
1541
  center: "center";
1542
+ right: "right";
1543
1543
  justify: "justify";
1544
1544
  }>>;
1545
1545
  verticalAlignment: z.ZodOptional<z.ZodEnum<{
@@ -1681,10 +1681,10 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
1681
1681
  }>;
1682
1682
  align: z.ZodEnum<{
1683
1683
  left: "left";
1684
+ center: "center";
1684
1685
  right: "right";
1685
1686
  top: "top";
1686
1687
  bottom: "bottom";
1687
- center: "center";
1688
1688
  inside: "inside";
1689
1689
  outside: "outside";
1690
1690
  }>;
@@ -1724,10 +1724,10 @@ declare const markdownContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffe
1724
1724
  }>;
1725
1725
  align: z.ZodEnum<{
1726
1726
  left: "left";
1727
+ center: "center";
1727
1728
  right: "right";
1728
1729
  top: "top";
1729
1730
  bottom: "bottom";
1730
- center: "center";
1731
1731
  inside: "inside";
1732
1732
  outside: "outside";
1733
1733
  }>;
@@ -89,19 +89,25 @@ const HTML_BLOCK_END_PATTERNS = [
89
89
  />/,
90
90
  /\]\]>/
91
91
  ];
92
+ const HTML_BLOCK_RAW_TEXT = 1;
93
+ const HTML_BLOCK_COMMENT = 2;
94
+ const HTML_BLOCK_PROCESSING_INSTRUCTION = 3;
95
+ const HTML_BLOCK_DECLARATION = 4;
96
+ const HTML_BLOCK_CDATA = 5;
97
+ const HTML_BLOCK_KNOWN_TAG = 6;
98
+ const HTML_BLOCK_ANY_COMPLETE_TAG = 7;
92
99
  const HTML_BLOCK_TYPES = [
93
- 1,
94
- 2,
95
- 3,
96
- 4,
97
- 5,
98
- 6,
99
- 7
100
+ HTML_BLOCK_RAW_TEXT,
101
+ HTML_BLOCK_COMMENT,
102
+ HTML_BLOCK_PROCESSING_INSTRUCTION,
103
+ HTML_BLOCK_DECLARATION,
104
+ HTML_BLOCK_CDATA,
105
+ HTML_BLOCK_KNOWN_TAG,
106
+ HTML_BLOCK_ANY_COMPLETE_TAG
100
107
  ];
101
- const LAST_HTML_BLOCK_TYPE = 7;
102
108
  function matchHtmlBlockStart(line, interruptsParagraph) {
103
109
  for (const type of HTML_BLOCK_TYPES) {
104
- if (type === LAST_HTML_BLOCK_TYPE && interruptsParagraph) continue;
110
+ if (type === HTML_BLOCK_ANY_COMPLETE_TAG && interruptsParagraph) continue;
105
111
  if (HTML_BLOCK_START_PATTERNS[type]?.test(line) === true) return type;
106
112
  }
107
113
  }
package/dist/html/html.js CHANGED
@@ -88,19 +88,25 @@ const HTML_BLOCK_END_PATTERNS = [
88
88
  />/,
89
89
  /\]\]>/
90
90
  ];
91
+ const HTML_BLOCK_RAW_TEXT = 1;
92
+ const HTML_BLOCK_COMMENT = 2;
93
+ const HTML_BLOCK_PROCESSING_INSTRUCTION = 3;
94
+ const HTML_BLOCK_DECLARATION = 4;
95
+ const HTML_BLOCK_CDATA = 5;
96
+ const HTML_BLOCK_KNOWN_TAG = 6;
97
+ const HTML_BLOCK_ANY_COMPLETE_TAG = 7;
91
98
  const HTML_BLOCK_TYPES = [
92
- 1,
93
- 2,
94
- 3,
95
- 4,
96
- 5,
97
- 6,
98
- 7
99
+ HTML_BLOCK_RAW_TEXT,
100
+ HTML_BLOCK_COMMENT,
101
+ HTML_BLOCK_PROCESSING_INSTRUCTION,
102
+ HTML_BLOCK_DECLARATION,
103
+ HTML_BLOCK_CDATA,
104
+ HTML_BLOCK_KNOWN_TAG,
105
+ HTML_BLOCK_ANY_COMPLETE_TAG
99
106
  ];
100
- const LAST_HTML_BLOCK_TYPE = 7;
101
107
  function matchHtmlBlockStart(line, interruptsParagraph) {
102
108
  for (const type of HTML_BLOCK_TYPES) {
103
- if (type === LAST_HTML_BLOCK_TYPE && interruptsParagraph) continue;
109
+ if (type === HTML_BLOCK_ANY_COMPLETE_TAG && interruptsParagraph) continue;
104
110
  if (HTML_BLOCK_START_PATTERNS[type]?.test(line) === true) return type;
105
111
  }
106
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-codec",
3
- "version": "11.1.11",
3
+ "version": "11.1.13",
4
4
  "description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
5
5
  "type": "module",
6
6
  "repository": {
@@ -83,7 +83,7 @@
83
83
  "license": "MIT",
84
84
  "packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
85
85
  "dependencies": {
86
- "byte-codec": "2.0.1",
86
+ "byte-codec": "2.0.2",
87
87
  "document-schema.js": "7.15.3",
88
88
  "zod": "4.4.3"
89
89
  },