markdown-codec 6.1.5 → 6.1.7
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/README.md +2 -2
- package/dist/codec.d.cts +276 -9
- package/dist/codec.d.ts +276 -9
- package/dist/emit/emit.cjs +176 -33
- package/dist/emit/emit.js +176 -33
- package/dist/lower/lower.cjs +2 -1
- package/dist/lower/lower.js +2 -1
- package/dist/shared/list-id.cjs +5 -3
- package/dist/shared/list-id.d.cts +2 -0
- package/dist/shared/list-id.d.ts +2 -0
- package/dist/shared/list-id.js +5 -3
- package/package.json +2 -2
package/dist/shared/list-id.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/shared/list-id.ts
|
|
2
|
-
const NUMID_PATTERN = /^md(\d+):(bullet|ordered)(?:@(\d+))?(\+task)?(\+loose)?$/;
|
|
2
|
+
const NUMID_PATTERN = /^md(\d+):(bullet|ordered)(?:@(\d+))?(\+task)?(\+loose)?(?:\+owner=(md-i\d+))?$/;
|
|
3
3
|
const DEFAULT_ORDERED_START = 1;
|
|
4
4
|
function createNumIdMintState() {
|
|
5
5
|
return { next: 1 };
|
|
@@ -10,7 +10,8 @@ function mintListNumId(state, options) {
|
|
|
10
10
|
const startSuffix = options.type === "ordered" && options.start !== void 0 && options.start !== DEFAULT_ORDERED_START ? `@${String(options.start)}` : "";
|
|
11
11
|
const taskSuffix = options.task ? "+task" : "";
|
|
12
12
|
const looseSuffix = options.loose ? "+loose" : "";
|
|
13
|
-
|
|
13
|
+
const ownerSuffix = options.ownerItemId !== void 0 ? `+owner=${options.ownerItemId}` : "";
|
|
14
|
+
return `md${String(id)}:${options.type}${startSuffix}${taskSuffix}${looseSuffix}${ownerSuffix}`;
|
|
14
15
|
}
|
|
15
16
|
function parseListNumId(numId) {
|
|
16
17
|
const match = NUMID_PATTERN.exec(numId);
|
|
@@ -22,7 +23,8 @@ function parseListNumId(numId) {
|
|
|
22
23
|
type,
|
|
23
24
|
start: type === "ordered" && startText !== void 0 ? Number.parseInt(startText, 10) : void 0,
|
|
24
25
|
task: match[4] !== void 0,
|
|
25
|
-
loose: match[5] !== void 0
|
|
26
|
+
loose: match[5] !== void 0,
|
|
27
|
+
ownerItemId: match[6]
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
function mintedListType(numId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-codec",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.7",
|
|
4
4
|
"description": "Hand-written CommonMark+GFM <-> DocumentTree codec, built on document-schema.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"license": "MIT",
|
|
82
82
|
"packageManager": "pnpm@11.6.0",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"document-schema.js": "^
|
|
84
|
+
"document-schema.js": "^6.0.0",
|
|
85
85
|
"zod": "^4.4.3"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|