MCPcopy Create free account
hub / github.com/angular/examples / maybeStripMarkdown

Function maybeStripMarkdown

genkit-angular-story-generator/src/flows.ts:299–305  ·  view source on GitHub ↗
(withMarkdown: string)

Source from the content-addressed store, hash-verified

297
298const markdownRegex = /^\s*(```json)?((.|\n)*?)(```)?\s*$/i;
299function maybeStripMarkdown(withMarkdown: string) {
300 const mdMatch = markdownRegex.exec(withMarkdown);
301 if (!mdMatch) {
302 return withMarkdown;
303 }
304 return mdMatch[2];
305}
306
307// For demonstration purposes only. It is recommended to use a proper data
308// store in a production application.

Callers 1

flows.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected