jamdesk 1.1.197 → 1.1.198
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter-utils.d.ts","sourceRoot":"","sources":["../../src/lib/frontmatter-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkE7D;
|
|
1
|
+
{"version":3,"file":"frontmatter-utils.d.ts","sourceRoot":"","sources":["../../src/lib/frontmatter-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkE7D;AAyFD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG;IAExD,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,CAIA;AAMD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -107,7 +107,8 @@ function markContinuationLines(lines) {
|
|
|
107
107
|
continue;
|
|
108
108
|
const [, indent, , value] = match;
|
|
109
109
|
// A block scalar always has a body; a plain value only sometimes wraps.
|
|
110
|
-
|
|
110
|
+
const block = isBlockScalar(value);
|
|
111
|
+
if (!block && !hasFoldedContinuation(lines, i))
|
|
111
112
|
continue;
|
|
112
113
|
for (let j = i + 1; j < lines.length; j++) {
|
|
113
114
|
// A blank line inside a block scalar is part of it; one at the end is
|
|
@@ -118,11 +119,32 @@ function markContinuationLines(lines) {
|
|
|
118
119
|
}
|
|
119
120
|
if (lines[j].search(/\S/) <= indent.length)
|
|
120
121
|
break;
|
|
122
|
+
// A block body is opaque text to the last line — `see mode: dark` in a
|
|
123
|
+
// `>-` description is prose and must survive verbatim. Outside one, an
|
|
124
|
+
// indented `key: value` really is a nested entry, and swallowing it was
|
|
125
|
+
// a regression: `seo:` has an empty value, which `hasFoldedContinuation`
|
|
126
|
+
// reads as a wrap whenever the child's name holds a `-` or `.` (its
|
|
127
|
+
// sibling test allows neither), so `seo:\n meta-description: A: B` had
|
|
128
|
+
// its colon left unquoted and js-yaml rejected the file — the very bug
|
|
129
|
+
// this function exists to prevent, re-entered through the back door.
|
|
130
|
+
if (!block && isYamlKeyLine(lines[j]))
|
|
131
|
+
break;
|
|
121
132
|
out[j] = true;
|
|
122
133
|
}
|
|
123
134
|
}
|
|
124
135
|
return out;
|
|
125
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* True if YAML itself would read this line as a mapping entry: a colon
|
|
139
|
+
* followed by whitespace or end-of-line. That trailing space is the whole
|
|
140
|
+
* distinction between `meta-description: A guide` (a key) and `Kotlin-SDK:er`
|
|
141
|
+
* (prose), and it is why this cannot reuse `KEY_LINE`, whose `\s*` makes the
|
|
142
|
+
* separator optional. The lazy `.*?` lets a colon-compound key like
|
|
143
|
+
* `og:title: Social` match on its real separator rather than its first colon.
|
|
144
|
+
*/
|
|
145
|
+
function isYamlKeyLine(line) {
|
|
146
|
+
return /^\s*[^\s#].*?:(\s|$)/.test(line);
|
|
147
|
+
}
|
|
126
148
|
/**
|
|
127
149
|
* True if the value on `lines[i]` continues onto a subsequent indented line
|
|
128
150
|
* (a YAML folded scalar without an explicit `|` or `>` indicator). The next
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter-utils.js","sourceRoot":"","sources":["../../src/lib/frontmatter-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,mCAAmC;IACnC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,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AAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,SAAS;QAC3B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,2EAA2E;QAC3E,4EAA4E;QAC5E,kFAAkF;QAClF,MAAM,mBAAmB,GAAG,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,OAAO,UAAU,IAAI,CAAC,mBAAmB,CAAC;IAC5C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IAKrD,MAAM,SAAS,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACxD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACvC,CAAC;AAED,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,wEAAwE;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamdesk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.198",
|
|
4
4
|
"description": "CLI for Jamdesk — build, preview, and deploy documentation sites from MDX. Dev server with hot reload, 50+ components, OpenAPI support, AI search, and Mintlify migration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jamdesk",
|
|
@@ -117,18 +117,40 @@ function markContinuationLines(lines: string[]): boolean[] {
|
|
|
117
117
|
if (!match) continue;
|
|
118
118
|
const [, indent, , value] = match;
|
|
119
119
|
// A block scalar always has a body; a plain value only sometimes wraps.
|
|
120
|
-
|
|
120
|
+
const block = isBlockScalar(value);
|
|
121
|
+
if (!block && !hasFoldedContinuation(lines, i)) continue;
|
|
121
122
|
for (let j = i + 1; j < lines.length; j++) {
|
|
122
123
|
// A blank line inside a block scalar is part of it; one at the end is
|
|
123
124
|
// harmless to mark, since the mapper skips blank lines anyway.
|
|
124
125
|
if (!lines[j].trim()) { out[j] = true; continue; }
|
|
125
126
|
if (lines[j].search(/\S/) <= indent.length) break;
|
|
127
|
+
// A block body is opaque text to the last line — `see mode: dark` in a
|
|
128
|
+
// `>-` description is prose and must survive verbatim. Outside one, an
|
|
129
|
+
// indented `key: value` really is a nested entry, and swallowing it was
|
|
130
|
+
// a regression: `seo:` has an empty value, which `hasFoldedContinuation`
|
|
131
|
+
// reads as a wrap whenever the child's name holds a `-` or `.` (its
|
|
132
|
+
// sibling test allows neither), so `seo:\n meta-description: A: B` had
|
|
133
|
+
// its colon left unquoted and js-yaml rejected the file — the very bug
|
|
134
|
+
// this function exists to prevent, re-entered through the back door.
|
|
135
|
+
if (!block && isYamlKeyLine(lines[j])) break;
|
|
126
136
|
out[j] = true;
|
|
127
137
|
}
|
|
128
138
|
}
|
|
129
139
|
return out;
|
|
130
140
|
}
|
|
131
141
|
|
|
142
|
+
/**
|
|
143
|
+
* True if YAML itself would read this line as a mapping entry: a colon
|
|
144
|
+
* followed by whitespace or end-of-line. That trailing space is the whole
|
|
145
|
+
* distinction between `meta-description: A guide` (a key) and `Kotlin-SDK:er`
|
|
146
|
+
* (prose), and it is why this cannot reuse `KEY_LINE`, whose `\s*` makes the
|
|
147
|
+
* separator optional. The lazy `.*?` lets a colon-compound key like
|
|
148
|
+
* `og:title: Social` match on its real separator rather than its first colon.
|
|
149
|
+
*/
|
|
150
|
+
function isYamlKeyLine(line: string): boolean {
|
|
151
|
+
return /^\s*[^\s#].*?:(\s|$)/.test(line);
|
|
152
|
+
}
|
|
153
|
+
|
|
132
154
|
/**
|
|
133
155
|
* True if the value on `lines[i]` continues onto a subsequent indented line
|
|
134
156
|
* (a YAML folded scalar without an explicit `|` or `>` indicator). The next
|
|
@@ -266,16 +266,23 @@ function markContinuationLines(lines) {
|
|
|
266
266
|
const match = lines[i].match(KEY_LINE);
|
|
267
267
|
if (!match) continue;
|
|
268
268
|
const [, indent, , value] = match;
|
|
269
|
-
|
|
269
|
+
const block = isBlockScalar(value);
|
|
270
|
+
if (!block && !hasFoldedContinuation(lines, i)) continue;
|
|
270
271
|
for (let j = i + 1; j < lines.length; j++) {
|
|
271
272
|
if (!lines[j].trim()) { out[j] = true; continue; }
|
|
272
273
|
if (lines[j].search(/\S/) <= indent.length) break;
|
|
274
|
+
if (!block && isYamlKeyLine(lines[j])) break;
|
|
273
275
|
out[j] = true;
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
278
|
return out;
|
|
277
279
|
}
|
|
278
280
|
|
|
281
|
+
/** Mirror of isYamlKeyLine in lib/frontmatter-utils.ts. */
|
|
282
|
+
function isYamlKeyLine(line) {
|
|
283
|
+
return /^\s*[^\s#].*?:(\s|$)/.test(line);
|
|
284
|
+
}
|
|
285
|
+
|
|
279
286
|
/** Mirror of hasFoldedContinuation in lib/frontmatter-utils.ts. */
|
|
280
287
|
function hasFoldedContinuation(lines, i) {
|
|
281
288
|
for (let j = i + 1; j < lines.length; j++) {
|