@fileverse-dev/ddoc 3.0.72-patch-1 → 3.0.73-blog-md-patch-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.
package/dist/index.es.js CHANGED
@@ -35351,22 +35351,27 @@ const o1e = (e, t, n) => yt.create({
35351
35351
  u.toJSON()
35352
35352
  ), d = c.getHTML(), p = dn.turndown(d), h = {
35353
35353
  title: (r == null ? void 0 : r.title) || "Untitled",
35354
- date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
35354
+ date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
35355
35355
  // YYYY-MM-DD
35356
- }, g = `---
35356
+ ...r == null ? void 0 : r.metadata
35357
+ };
35358
+ let f;
35359
+ if ((r == null ? void 0 : r.metadataFormat) === "reference-links" ? f = Object.entries(h).map(([y, x]) => `[${y}]: <> (${x})`).join(`
35360
+ `) + `
35361
+
35362
+ ` + p : f = `---
35357
35363
  ` + Object.entries(h).map(([y, x]) => Array.isArray(x) ? `${y}:
35358
35364
  ${x.map((v) => ` - ${v}`).join(`
35359
35365
  `)}` : `${y}: ${x}`).join(`
35360
35366
  `) + `
35361
35367
  ---
35362
35368
 
35363
- ` + p;
35364
- if (r != null && r.returnMDFile)
35365
- return c.destroy(), s(a), g;
35366
- const m = new Blob([g], {
35369
+ ` + p, r != null && r.returnMDFile)
35370
+ return c.destroy(), s(a), f;
35371
+ const g = new Blob([f], {
35367
35372
  type: "text/markdown;charset=utf-8"
35368
- }), b = URL.createObjectURL(m);
35369
- return c.destroy(), s(a), b;
35373
+ }), m = URL.createObjectURL(g);
35374
+ return c.destroy(), s(a), m;
35370
35375
  }
35371
35376
  };
35372
35377
  },
@@ -13,6 +13,8 @@ declare module '@tiptap/core' {
13
13
  exportMarkdownFile: (props?: {
14
14
  title?: string;
15
15
  returnMDFile?: boolean;
16
+ metadataFormat?: 'yaml' | 'reference-links';
17
+ metadata?: Record<string, string>;
16
18
  }) => any;
17
19
  };
18
20
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.0.72-patch-1",
5
+ "version": "3.0.73-blog-md-patch-1",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {