@gpdoc/filekit 1.20.0 → 1.21.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpdoc/filekit",
3
- "version": "1.20.0",
3
+ "version": "1.21.1",
4
4
  "type": "module",
5
5
  "description": "Headless GPDoc file format detection, validation, and text conversion",
6
6
  "repository": "https://github.com/repetere/gpdoc.git",
package/src/index.js CHANGED
@@ -328,8 +328,10 @@ export function createManagedDocument(title = 'Untitled', body = '') {
328
328
  }
329
329
 
330
330
  export function serializeManagedMarkdown(metadata, body) {
331
- const root = { gpdoc_metadata: { ...metadata, content: undefined } };
332
- root.gpdoc_metadata.content = { document: String(body) };
331
+ // @spec CLI-001, CLI-066
332
+ // Markdown has a separate body. `content.document` is reserved for GPDoc JSON.
333
+ const { content: _content, ...frontMatterMetadata } = metadata || {};
334
+ const root = { gpdoc_metadata: frontMatterMetadata };
333
335
  return `---\n${yaml.dump(root, { schema: yaml.JSON_SCHEMA, noRefs: true, lineWidth: -1 }).trimEnd()}\n---\n${String(body)}`;
334
336
  }
335
337