featherdown 0.2.0 → 0.3.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.
@@ -0,0 +1,75 @@
1
+ import { R as RenderDiagnostic, b as RenderMarkdownOptions } from './types-Blk9BrZ4.js';
2
+ import { Root as Root$1 } from 'hast';
3
+ import { Root } from 'mdast';
4
+ import { Processor, Plugin } from 'unified';
5
+
6
+ /**
7
+ * Emits a non-fatal rendering diagnostic.
8
+ */
9
+ type DiagnosticEmitter = (d: RenderDiagnostic) => void;
10
+
11
+ /** Optional pipeline stages for {@link Featherdown}; omit for legacy all-on behavior. */
12
+ type MarkdownProcessorFeatureGates = {
13
+ math: boolean;
14
+ code: boolean;
15
+ codeHighlighting: boolean;
16
+ charts: boolean;
17
+ sanitize: boolean;
18
+ };
19
+ type InternalOptions = RenderMarkdownOptions & {
20
+ emitDiagnostic?: DiagnosticEmitter;
21
+ preserveHeadingCustomIdMarker?: boolean;
22
+ features?: MarkdownProcessorFeatureGates;
23
+ };
24
+ /**
25
+ * Build the default browser-safe unified processor used by public APIs.
26
+ *
27
+ * Internal helper that wires remark/rehype plugins for math, highlighting,
28
+ * sanitization, heading ids, chart placeholders, and image rewriting.
29
+ */
30
+ declare function createMarkdownProcessorInternal(options?: InternalOptions): Processor<Root, Root, Root$1>;
31
+
32
+ /**
33
+ * Create a browser-safe unified processor configured for featherdown defaults.
34
+ *
35
+ * Advanced API for users who need direct unified processor control.
36
+ * Most users should use `Featherdown`.
37
+ *
38
+ * This entrypoint exports the lower-level processor factory so callers can run
39
+ * custom `.process()` flows while still using the package's sanitization and
40
+ * plugin pipeline. Prefer importing from `featherdown/advanced` when wiring
41
+ * unified integrations.
42
+ */
43
+ declare function createMarkdownProcessor(options?: RenderMarkdownOptions): ReturnType<typeof createMarkdownProcessorInternal>;
44
+
45
+ /**
46
+ * Advanced rehype plugin: converts supported `chart-*` fenced JSON blocks into
47
+ * chart mount placeholders in the output HTML tree.
48
+ *
49
+ * Most users should use `Featherdown`, which includes this pipeline by default.
50
+ * Prefer importing from `featherdown/advanced` for direct rehype integration.
51
+ */
52
+ /**
53
+ * Replaces supported `chart-…` fenced JSON blocks with a mount placeholder.
54
+ * Invalid JSON leaves the original `<pre><code>` unchanged.
55
+ */
56
+ declare const rehypeChartBlocks: Plugin<[], Root$1>;
57
+
58
+ /**
59
+ * Advanced rehype plugin: annotates images and can rewrite `src` using
60
+ * caller-provided manifest mappings.
61
+ *
62
+ * Most users should use `Featherdown`, which includes this pipeline by default.
63
+ * Prefer importing from `featherdown/advanced` for direct rehype integration.
64
+ */
65
+ /**
66
+ * Options accepted by `rehypeCdnImages`.
67
+ */
68
+ type RehypeCdnImagesOptions = RenderMarkdownOptions;
69
+ /**
70
+ * Adds `markdown-inline-img` to all images and optionally rewrites `src` using
71
+ * caller-provided manifest data.
72
+ */
73
+ declare const rehypeCdnImages: Plugin<[RehypeCdnImagesOptions?], Root$1>;
74
+
75
+ export { createMarkdownProcessor, rehypeCdnImages, rehypeChartBlocks };
@@ -0,0 +1,4 @@
1
+ export { createMarkdownProcessor, rehypeCdnImages, rehypeChartBlocks } from './chunk-DNLCIOR6.js';
2
+ import './chunk-YKLQHPRB.js';
3
+ //# sourceMappingURL=advanced.js.map
4
+ //# sourceMappingURL=advanced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"advanced.js"}
@@ -0,0 +1,558 @@
1
+ import { createMarkdownProcessorInternal } from './chunk-YKLQHPRB.js';
2
+ import yaml from 'js-yaml';
3
+ import { toText } from 'hast-util-to-text';
4
+ import { visit, EXIT } from 'unist-util-visit';
5
+
6
+ // src/featherdownDiagnosticsError.ts
7
+ var FeatherdownDiagnosticsError = class extends Error {
8
+ name = "FeatherdownDiagnosticsError";
9
+ diagnostics;
10
+ /**
11
+ * Full parse result as built before the strict check, including `html` and
12
+ * the same `diagnostics` array as {@link FeatherdownDiagnosticsError.diagnostics}.
13
+ * Omitted when the error is constructed without a result (internal use only).
14
+ */
15
+ result;
16
+ constructor(diagnostics, result) {
17
+ super(`Featherdown strict diagnostics failed with ${String(diagnostics.length)} diagnostic(s).`);
18
+ this.diagnostics = diagnostics;
19
+ this.result = result;
20
+ Object.setPrototypeOf(this, new.target.prototype);
21
+ }
22
+ };
23
+
24
+ // src/internal/buildFeatherdownResult.ts
25
+ function buildStyleAssets(resolved) {
26
+ const styles = ["featherdown/styles/base.css"];
27
+ if (resolved.math.enabled) {
28
+ styles.push("featherdown/styles/katex.css");
29
+ }
30
+ if (resolved.code.enabled) {
31
+ styles.push("featherdown/styles/code.css");
32
+ if (resolved.code.highlighting) {
33
+ styles.push("featherdown/styles/highlight.css");
34
+ }
35
+ }
36
+ return styles;
37
+ }
38
+ function buildAssets(resolved, mermaidFeature) {
39
+ return {
40
+ styles: buildStyleAssets(resolved),
41
+ scripts: [],
42
+ features: {
43
+ math: resolved.math.enabled,
44
+ code: resolved.code.enabled,
45
+ charts: resolved.charts,
46
+ mermaid: mermaidFeature
47
+ }
48
+ };
49
+ }
50
+ function buildFeatherdownResult(args) {
51
+ const { body, frontmatter, metadata, document: doc, options: resolved, mermaidFeature } = args;
52
+ const mermaidEnabled = mermaidFeature === true;
53
+ let diagnostics = doc.diagnostics;
54
+ if (!resolved.diagnostics.enabled) {
55
+ diagnostics = [];
56
+ }
57
+ let toc = doc.toc;
58
+ let headings = doc.headings;
59
+ if (!resolved.headings.enabled) {
60
+ toc = [];
61
+ headings = [];
62
+ } else if (!resolved.headings.toc) {
63
+ toc = [];
64
+ }
65
+ let excerpt = doc.excerpt;
66
+ let wordCount = doc.wordCount;
67
+ let estimatedReadingMinutes = doc.estimatedReadingMinutes;
68
+ if (!resolved.publishing.excerpt) {
69
+ excerpt = null;
70
+ }
71
+ if (!resolved.publishing.wordCount) {
72
+ wordCount = 0;
73
+ }
74
+ if (!resolved.publishing.readingTime) {
75
+ estimatedReadingMinutes = 0;
76
+ }
77
+ return {
78
+ html: doc.html,
79
+ diagnostics,
80
+ toc,
81
+ headings,
82
+ excerpt,
83
+ wordCount,
84
+ estimatedReadingMinutes,
85
+ body,
86
+ frontmatter,
87
+ metadata,
88
+ stats: {
89
+ wordCount,
90
+ readingTimeMinutes: estimatedReadingMinutes
91
+ },
92
+ assets: buildAssets(resolved, mermaidEnabled)
93
+ };
94
+ }
95
+
96
+ // src/internal/buildMetadataFromFrontmatter.ts
97
+ function buildMetadataFromFrontmatter(frontmatter) {
98
+ const metadata = {};
99
+ if (typeof frontmatter.title === "string") {
100
+ metadata.title = frontmatter.title;
101
+ }
102
+ if (typeof frontmatter.description === "string") {
103
+ metadata.description = frontmatter.description;
104
+ }
105
+ if (typeof frontmatter.date === "string") {
106
+ metadata.date = frontmatter.date;
107
+ }
108
+ if (typeof frontmatter.updated === "string") {
109
+ metadata.updated = frontmatter.updated;
110
+ }
111
+ if (typeof frontmatter.status === "string") {
112
+ metadata.status = frontmatter.status;
113
+ }
114
+ if (typeof frontmatter.author === "string") {
115
+ metadata.author = frontmatter.author;
116
+ }
117
+ const tags = frontmatter.tags;
118
+ if (Array.isArray(tags) && tags.length > 0 && tags.every((t) => typeof t === "string")) {
119
+ metadata.tags = tags.filter((t) => typeof t === "string");
120
+ }
121
+ return metadata;
122
+ }
123
+
124
+ // src/internal/featherdownParseHelpers.ts
125
+ function pickRenderMarkdownOptions(merged) {
126
+ if (!merged) {
127
+ return void 0;
128
+ }
129
+ const { kind, slug, manifest } = merged;
130
+ if (kind === void 0 && slug === void 0 && manifest === void 0) {
131
+ return void 0;
132
+ }
133
+ const r = {};
134
+ if (kind !== void 0) {
135
+ r.kind = kind;
136
+ }
137
+ if (slug !== void 0) {
138
+ r.slug = slug;
139
+ }
140
+ if (manifest !== void 0) {
141
+ r.manifest = manifest;
142
+ }
143
+ return r;
144
+ }
145
+ function toProcessorGates(resolved) {
146
+ return {
147
+ math: resolved.math.enabled,
148
+ code: resolved.code.enabled,
149
+ codeHighlighting: resolved.code.enabled && resolved.code.highlighting,
150
+ charts: resolved.charts,
151
+ sanitize: resolved.sanitize
152
+ };
153
+ }
154
+ var FRONT_MATTER_FENCE = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
155
+ function extractFrontMatter(raw, yamlMode) {
156
+ if (!raw.startsWith("---")) {
157
+ return { body: raw, frontmatter: {}, hasFrontmatter: false };
158
+ }
159
+ const match = FRONT_MATTER_FENCE.exec(raw);
160
+ if (!match) {
161
+ return { body: raw, frontmatter: {}, hasFrontmatter: false };
162
+ }
163
+ const yamlSource = match[1] ?? "";
164
+ const bodyAfterFence = raw.slice(match[0].length);
165
+ try {
166
+ const loaded = yaml.load(yamlSource);
167
+ if (loaded === void 0 || loaded === null) {
168
+ return { body: bodyAfterFence, frontmatter: {}, hasFrontmatter: true };
169
+ }
170
+ if (typeof loaded !== "object" || Array.isArray(loaded)) {
171
+ if (yamlMode === "strict") {
172
+ throw new Error(
173
+ "Front matter root must be a YAML mapping (object), not a list or scalar."
174
+ );
175
+ }
176
+ return { body: raw, frontmatter: {}, hasFrontmatter: false };
177
+ }
178
+ return {
179
+ body: bodyAfterFence,
180
+ frontmatter: loaded,
181
+ hasFrontmatter: true
182
+ };
183
+ } catch (e) {
184
+ if (yamlMode === "strict") {
185
+ if (e instanceof Error && e.message.startsWith("Front matter")) {
186
+ throw e;
187
+ }
188
+ const detail = e instanceof Error ? e.message : String(e);
189
+ throw new Error(`Front matter YAML could not be parsed: ${detail}`);
190
+ }
191
+ return { body: raw, frontmatter: {}, hasFrontmatter: false };
192
+ }
193
+ }
194
+ function extractFrontMatterStrict(raw) {
195
+ return extractFrontMatter(raw, "strict");
196
+ }
197
+ function extractFrontMatterLenient(raw) {
198
+ return extractFrontMatter(raw, "lenient");
199
+ }
200
+ function parseFrontmatter(markdown, mode) {
201
+ if (mode === false) {
202
+ return { body: markdown, frontmatter: {}, hasFrontmatter: false };
203
+ }
204
+ return extractFrontMatterLenient(markdown);
205
+ }
206
+
207
+ // src/internal/diagnostics.ts
208
+ function createDiagnosticCollector() {
209
+ const diagnostics = [];
210
+ const emit = (d) => {
211
+ diagnostics.push(d);
212
+ };
213
+ return {
214
+ emit,
215
+ diagnostics
216
+ };
217
+ }
218
+
219
+ // src/internal/renderMarkdownDocumentInternal.ts
220
+ var WORDS_PER_MINUTE = 200;
221
+ var excerptTagNames = /* @__PURE__ */ new Set(["p", "blockquote", "li"]);
222
+ function normalizeText(text) {
223
+ return text.replace(/\s+/g, " ").trim();
224
+ }
225
+ function getHeadingDepth(tagName) {
226
+ const match = /^h([1-6])$/.exec(tagName);
227
+ if (!match) {
228
+ return null;
229
+ }
230
+ return Number(match[1]);
231
+ }
232
+ function isParagraphLikeTagName(tagName) {
233
+ return excerptTagNames.has(tagName);
234
+ }
235
+ function isCustomHeadingId(value) {
236
+ return value === true || value === "true" || value === "";
237
+ }
238
+ function extractHeadings(root) {
239
+ const headings = [];
240
+ visit(root, "element", (node) => {
241
+ const depth = getHeadingDepth(node.tagName);
242
+ if (!depth) {
243
+ return;
244
+ }
245
+ const id = typeof node.properties.id === "string" ? node.properties.id : "";
246
+ if (!id) {
247
+ return;
248
+ }
249
+ const text = normalizeText(toText(node));
250
+ if (!text) {
251
+ return;
252
+ }
253
+ headings.push({
254
+ index: headings.length,
255
+ depth,
256
+ text,
257
+ id,
258
+ hasCustomId: isCustomHeadingId(node.properties.dataHeadingCustomId)
259
+ });
260
+ delete node.properties.dataHeadingCustomId;
261
+ });
262
+ return headings;
263
+ }
264
+ function extractToc(headings) {
265
+ return headings.map((heading) => ({
266
+ depth: heading.depth,
267
+ text: heading.text,
268
+ id: heading.id
269
+ }));
270
+ }
271
+ function extractExcerpt(root) {
272
+ let excerpt = null;
273
+ visit(root, "element", (node) => {
274
+ if (excerpt !== null) {
275
+ return EXIT;
276
+ }
277
+ if (!isParagraphLikeTagName(node.tagName)) {
278
+ return;
279
+ }
280
+ const text = normalizeText(toText(node));
281
+ if (!text) {
282
+ return;
283
+ }
284
+ excerpt = text;
285
+ return EXIT;
286
+ });
287
+ return excerpt;
288
+ }
289
+ function countWords(root) {
290
+ const text = normalizeText(toText(root));
291
+ if (!text) {
292
+ return 0;
293
+ }
294
+ const words = text.match(/\S+/g);
295
+ return words ? words.length : 0;
296
+ }
297
+ function estimateReadingMinutes(wordCount) {
298
+ if (wordCount <= 0) {
299
+ return 0;
300
+ }
301
+ return Math.max(1, Math.ceil(wordCount / WORDS_PER_MINUTE));
302
+ }
303
+ async function renderMarkdownDocumentInternal(markdown, options, pipelineFeatures) {
304
+ const collector = createDiagnosticCollector();
305
+ const processor = createMarkdownProcessorInternal({
306
+ ...options,
307
+ emitDiagnostic: collector.emit,
308
+ preserveHeadingCustomIdMarker: true,
309
+ ...pipelineFeatures !== void 0 ? { features: pipelineFeatures } : {}
310
+ });
311
+ const parsed = processor.parse(markdown);
312
+ const root = await processor.run(parsed);
313
+ const headings = extractHeadings(root);
314
+ const html = String(processor.stringify(root));
315
+ const wordCount = countWords(root);
316
+ return {
317
+ html,
318
+ diagnostics: collector.diagnostics,
319
+ toc: extractToc(headings),
320
+ headings,
321
+ excerpt: extractExcerpt(root),
322
+ wordCount,
323
+ estimatedReadingMinutes: estimateReadingMinutes(wordCount)
324
+ };
325
+ }
326
+
327
+ // src/internal/resolveFeatherdownOptions.ts
328
+ var DEFAULT_MATH = { enabled: true };
329
+ var DEFAULT_CODE = {
330
+ enabled: true,
331
+ highlighting: true,
332
+ lineNumbers: false,
333
+ copyButton: true
334
+ };
335
+ var DEFAULT_HEADINGS = {
336
+ enabled: true,
337
+ slugs: true,
338
+ anchors: true,
339
+ toc: true
340
+ };
341
+ var DEFAULT_PUBLISHING = {
342
+ excerpt: true,
343
+ wordCount: true,
344
+ readingTime: true
345
+ };
346
+ function mergeFeatherdownMathGroup(ctor, parse) {
347
+ if (parse !== void 0) {
348
+ if (typeof parse === "boolean") {
349
+ return parse;
350
+ }
351
+ if (ctor !== void 0 && typeof ctor === "object") {
352
+ return { ...ctor, ...parse };
353
+ }
354
+ return { ...parse };
355
+ }
356
+ return ctor;
357
+ }
358
+ function mergeFeatherdownCodeGroup(ctor, parse) {
359
+ if (parse !== void 0) {
360
+ if (typeof parse === "boolean") {
361
+ return parse;
362
+ }
363
+ if (ctor !== void 0 && typeof ctor === "object") {
364
+ return { ...ctor, ...parse };
365
+ }
366
+ return { ...parse };
367
+ }
368
+ return ctor;
369
+ }
370
+ function mergeFeatherdownHeadingsGroup(ctor, parse) {
371
+ if (parse !== void 0) {
372
+ if (typeof parse === "boolean") {
373
+ return parse;
374
+ }
375
+ if (ctor !== void 0 && typeof ctor === "object") {
376
+ return { ...ctor, ...parse };
377
+ }
378
+ return { ...parse };
379
+ }
380
+ return ctor;
381
+ }
382
+ function mergeFeatherdownPublishingGroup(ctor, parse) {
383
+ if (parse !== void 0) {
384
+ if (typeof parse === "boolean") {
385
+ return parse;
386
+ }
387
+ if (ctor !== void 0 && typeof ctor === "object") {
388
+ return { ...ctor, ...parse };
389
+ }
390
+ return { ...parse };
391
+ }
392
+ return ctor;
393
+ }
394
+ function mergeFeatherdownOptions(constructorOptions, parseOptions) {
395
+ if (constructorOptions === void 0 && parseOptions === void 0) {
396
+ return void 0;
397
+ }
398
+ const out = { ...constructorOptions, ...parseOptions };
399
+ const mathMerged = mergeFeatherdownMathGroup(constructorOptions?.math, parseOptions?.math);
400
+ if (mathMerged !== void 0) {
401
+ out.math = mathMerged;
402
+ }
403
+ const codeMerged = mergeFeatherdownCodeGroup(constructorOptions?.code, parseOptions?.code);
404
+ if (codeMerged !== void 0) {
405
+ out.code = codeMerged;
406
+ }
407
+ const headingsMerged = mergeFeatherdownHeadingsGroup(constructorOptions?.headings, parseOptions?.headings);
408
+ if (headingsMerged !== void 0) {
409
+ out.headings = headingsMerged;
410
+ }
411
+ const publishingMerged = mergeFeatherdownPublishingGroup(constructorOptions?.publishing, parseOptions?.publishing);
412
+ if (publishingMerged !== void 0) {
413
+ out.publishing = publishingMerged;
414
+ }
415
+ return out;
416
+ }
417
+ function normalizeMath(value, base) {
418
+ if (value === void 0) {
419
+ return { ...base };
420
+ }
421
+ if (typeof value === "boolean") {
422
+ return { enabled: value };
423
+ }
424
+ return {
425
+ enabled: value.enabled ?? base.enabled
426
+ };
427
+ }
428
+ function normalizeCode(value, base) {
429
+ if (value === void 0) {
430
+ return { ...base };
431
+ }
432
+ if (typeof value === "boolean") {
433
+ return {
434
+ ...base,
435
+ enabled: value
436
+ };
437
+ }
438
+ return {
439
+ enabled: value.enabled ?? base.enabled,
440
+ highlighting: value.highlighting ?? base.highlighting,
441
+ lineNumbers: value.lineNumbers ?? base.lineNumbers,
442
+ copyButton: value.copyButton ?? base.copyButton
443
+ };
444
+ }
445
+ function normalizeHeadings(value, base) {
446
+ if (value === void 0) {
447
+ return { ...base };
448
+ }
449
+ if (typeof value === "boolean") {
450
+ if (!value) {
451
+ return {
452
+ enabled: false,
453
+ slugs: false,
454
+ anchors: false,
455
+ toc: false
456
+ };
457
+ }
458
+ return { ...DEFAULT_HEADINGS };
459
+ }
460
+ return {
461
+ enabled: true,
462
+ slugs: value.slugs ?? base.slugs,
463
+ anchors: value.anchors ?? base.anchors,
464
+ toc: value.toc ?? base.toc
465
+ };
466
+ }
467
+ function normalizePublishing(value, base) {
468
+ if (value === void 0) {
469
+ return { ...base };
470
+ }
471
+ if (typeof value === "boolean") {
472
+ if (!value) {
473
+ return { excerpt: false, wordCount: false, readingTime: false };
474
+ }
475
+ return { ...DEFAULT_PUBLISHING };
476
+ }
477
+ return {
478
+ excerpt: value.excerpt ?? base.excerpt,
479
+ wordCount: value.wordCount ?? base.wordCount,
480
+ readingTime: value.readingTime ?? base.readingTime
481
+ };
482
+ }
483
+ function normalizeFrontmatter(value) {
484
+ if (value === true || value === "auto") {
485
+ return value;
486
+ }
487
+ return false;
488
+ }
489
+ function normalizeDiagnostics(value) {
490
+ if (value === void 0) {
491
+ return { enabled: true, mode: "warn" };
492
+ }
493
+ if (value === false) {
494
+ return { enabled: false, mode: "warn" };
495
+ }
496
+ if (value === true) {
497
+ return { enabled: true, mode: "warn" };
498
+ }
499
+ return { enabled: true, mode: value };
500
+ }
501
+ function resolveFeatherdownOptions(raw) {
502
+ const mergedNested = raw ?? {};
503
+ return {
504
+ ...mergedNested.kind !== void 0 ? { kind: mergedNested.kind } : {},
505
+ ...mergedNested.slug !== void 0 ? { slug: mergedNested.slug } : {},
506
+ ...mergedNested.manifest !== void 0 ? { manifest: mergedNested.manifest } : {},
507
+ math: normalizeMath(mergedNested.math, DEFAULT_MATH),
508
+ code: normalizeCode(mergedNested.code, DEFAULT_CODE),
509
+ sanitize: mergedNested.sanitize ?? true,
510
+ diagnostics: normalizeDiagnostics(mergedNested.diagnostics),
511
+ charts: mergedNested.charts ?? true,
512
+ headings: normalizeHeadings(mergedNested.headings, DEFAULT_HEADINGS),
513
+ publishing: normalizePublishing(mergedNested.publishing, DEFAULT_PUBLISHING),
514
+ frontmatter: normalizeFrontmatter(mergedNested.frontmatter)
515
+ };
516
+ }
517
+
518
+ // src/internal/throwIfStrictDiagnosticsViolated.ts
519
+ function throwIfStrictDiagnosticsViolated(resolved, result) {
520
+ if (resolved.diagnostics.mode !== "strict" || result.diagnostics.length === 0) {
521
+ return;
522
+ }
523
+ throw new FeatherdownDiagnosticsError(result.diagnostics, result);
524
+ }
525
+
526
+ // src/featherdown.ts
527
+ var Featherdown = class {
528
+ defaultOptions;
529
+ constructor(options) {
530
+ this.defaultOptions = options;
531
+ }
532
+ /**
533
+ * Render Markdown to HTML and document metadata. Constructor options are merged
534
+ * with per-call options; per-call values win. Nested option groups use a
535
+ * shallow one-level merge.
536
+ */
537
+ async parse(markdown, parseOptions) {
538
+ const mergedOptions = mergeFeatherdownOptions(this.defaultOptions, parseOptions);
539
+ const resolvedOptions = resolveFeatherdownOptions(mergedOptions);
540
+ const legacy = pickRenderMarkdownOptions(mergedOptions);
541
+ const fm = parseFrontmatter(markdown, resolvedOptions.frontmatter);
542
+ const metadata = buildMetadataFromFrontmatter(fm.frontmatter);
543
+ const document = await renderMarkdownDocumentInternal(fm.body, legacy, toProcessorGates(resolvedOptions));
544
+ const result = buildFeatherdownResult({
545
+ body: fm.body,
546
+ frontmatter: fm.frontmatter,
547
+ metadata,
548
+ document,
549
+ options: resolvedOptions
550
+ });
551
+ throwIfStrictDiagnosticsViolated(resolvedOptions, result);
552
+ return result;
553
+ }
554
+ };
555
+
556
+ export { Featherdown, FeatherdownDiagnosticsError, buildFeatherdownResult, buildMetadataFromFrontmatter, createDiagnosticCollector, extractFrontMatterStrict, mergeFeatherdownOptions, parseFrontmatter, pickRenderMarkdownOptions, renderMarkdownDocumentInternal, resolveFeatherdownOptions, throwIfStrictDiagnosticsViolated, toProcessorGates };
557
+ //# sourceMappingURL=chunk-CWUDY7YI.js.map
558
+ //# sourceMappingURL=chunk-CWUDY7YI.js.map