flex-md 4.2.7 → 4.2.8

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/dist/md/parse.js +4 -8
  2. package/package.json +1 -1
package/dist/md/parse.js CHANGED
@@ -1,4 +1,4 @@
1
- import { toCamelCase } from "nx-helpers";
1
+ import { MarkdownParser } from "nx-md-parser";
2
2
  export function normalizeName(s) {
3
3
  return s.trim().replace(/\s+/g, " ").toLowerCase();
4
4
  }
@@ -158,11 +158,7 @@ export function isIssuesEnvelopeCheck(md) {
158
158
  export function markdownToJson(md) {
159
159
  // Robustly handle both actual newlines and literal \n (common in LLM JSON outputs)
160
160
  const normalizedMd = (md || "").replace(/\\n/g, "\n");
161
- const sections = parseHeadingsAndSections(normalizedMd);
162
- const result = {};
163
- for (const sec of sections) {
164
- const key = toCamelCase(sec.heading.name);
165
- result[key] = sec.body.trim();
166
- }
167
- return result;
161
+ // Use the powerful nx-md-parser for robust section detection
162
+ const sections = MarkdownParser.parseSections(normalizedMd);
163
+ return MarkdownParser.sectionsToObject(sections);
168
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flex-md",
3
- "version": "4.2.7",
3
+ "version": "4.2.8",
4
4
  "description": "Parse and stringify FlexMD: semi-structured Markdown with three powerful layers - Frames, Output Format Spec (OFS), and Detection/Extraction.",
5
5
  "license": "MIT",
6
6
  "author": "",