MCPcopy Index your code
hub / github.com/github/awesome-copilot / parseLooseSteps

Function parseLooseSteps

extensions/java-modernization-studio/scan.mjs:181–198  ·  view source on GitHub ↗
(md)

Source from the content-addressed store, hash-verified

179
180// Fallbacks when there are no checkbox items: numbered steps, then H2/H3 headings.
181function parseLooseSteps(md) {
182 const numbered = [];
183 let section = null;
184 for (const line of md.split(/\r?\n/)) {
185 const h = line.match(/^\s*#{1,6}\s+(.*\S)\s*$/);
186 if (h) { section = stripMd(h[1]); continue; }
187 const m = line.match(/^\s*\d+[.)]\s+(.*\S)\s*$/);
188 if (m) numbered.push({ title: stripMd(m[1]), status: statusFromText(m[1]) || "pending", section });
189 }
190 if (numbered.length) return numbered;
191
192 const headings = [];
193 for (const line of md.split(/\r?\n/)) {
194 const m = line.match(/^\s*#{2,4}\s+(.*\S)\s*$/);
195 if (m) headings.push({ title: stripMd(m[1]), status: statusFromText(m[1]) || "pending", section: null });
196 }
197 return headings;
198}
199
200function parseSteps(md) {
201 if (!md) return [];

Callers 1

parseStepsFunction · 0.85

Calls 2

stripMdFunction · 0.85
statusFromTextFunction · 0.85

Tested by

no test coverage detected