@san-siva/blogkit-md 0.3.12 → 0.3.13

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.js CHANGED
@@ -55,12 +55,15 @@ var parseMarkdown = (content) => {
55
55
  let frontmatter = {};
56
56
  if (((_a = ast.children[0]) == null ? void 0 : _a.type) === "yaml") {
57
57
  const raw = ast.children[0].value;
58
- const parsed = parseYaml(raw);
59
- const title = (_b = parsed.title) != null ? _b : parsed.name;
60
- frontmatter = {
61
- title: typeof title === "string" ? title : void 0,
62
- description: typeof parsed.description === "string" ? parsed.description : void 0
63
- };
58
+ try {
59
+ const parsed = parseYaml(raw);
60
+ const title = (_b = parsed.title) != null ? _b : parsed.name;
61
+ frontmatter = {
62
+ title: typeof title === "string" ? title : void 0,
63
+ description: typeof parsed.description === "string" ? parsed.description : void 0
64
+ };
65
+ } catch (e) {
66
+ }
64
67
  ast.children.shift();
65
68
  }
66
69
  frontmatter = consumeH1Title(ast, frontmatter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@san-siva/blogkit-md",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Converts markdown files into JSX blog posts for Blogkit",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -21,7 +21,7 @@
21
21
  "fix": "eslint . --config eslint.config.ts --fix"
22
22
  },
23
23
  "dependencies": {
24
- "@san-siva/blogkit": "^1.1.35",
24
+ "@san-siva/blogkit": "^1.1.36",
25
25
  "@san-siva/stylekit": "^1.0.13",
26
26
  "next": "^16.0.10",
27
27
  "react": "^19.0.0",
@@ -36,12 +36,16 @@ export const parseMarkdown = (content: string): ParseResult => {
36
36
 
37
37
  if (ast.children[0]?.type === 'yaml') {
38
38
  const raw = (ast.children[0] as Yaml).value;
39
- const parsed = parseYaml(raw) as Record<string, unknown>;
40
- const title = parsed.title ?? parsed.name;
41
- frontmatter = {
42
- title: typeof title === 'string' ? title : undefined,
43
- description: typeof parsed.description === 'string' ? parsed.description : undefined,
44
- };
39
+ try {
40
+ const parsed = parseYaml(raw) as Record<string, unknown>;
41
+ const title = parsed.title ?? parsed.name;
42
+ frontmatter = {
43
+ title: typeof title === 'string' ? title : undefined,
44
+ description: typeof parsed.description === 'string' ? parsed.description : undefined,
45
+ };
46
+ } catch {
47
+ // Invalid YAML frontmatter — ignore and fall through to H1 title extraction
48
+ }
45
49
  ast.children.shift();
46
50
  }
47
51