Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
// Set up markdown renderer for summary
const renderer = new marked.Renderer()
renderer.code = (code, lang) =>
`<pre><code class="hljs">${
hljs.highlightAuto(code, lang ? [lang] : undefined).value
}</code></pre>`
marked.setOptions({ renderer })
return {
title: kindName,
subtitle: storyName,
summary: marked(dedent(options.summary)),
storySource: dedent(
story.template || getJSXFromRenderFn(story.render! as any)
),
jsxStory: !!story.render,
components
}
}
// Set up markdown renderer for summary
const renderer = new marked.Renderer()
renderer.code = (code, lang) =>
`<pre><code class="hljs">${
hljs.highlightAuto(code, lang ? [lang] : undefined).value
}</code></pre>`
marked.setOptions({ renderer })
return {
title: kindName,
subtitle: storyName,
summary: marked(dedent(options.summary)),
storySource: dedent(
story.template || getJSXFromRenderFn(story.render! as any)
),
jsxStory: !!story.render,
components
}
}
export const fromTemplate = (template: string): string[] => {
const { ast } = compile(dedent(template))
if (!ast) {
return []
}
return removeDuplicates(retrieveTagNamesFromAST(ast))
}