The markdown string containing the code block.
An object containing the language and the code from the markdown code block.
This function uses regular expressions to parse the markdown code block.
Throws an error if the markdown code block cannot be parsed.
const markdown = "```javascript\nconsole.log('Hello, World!');\n```";
parseMarkdownCodeBlock(markdown);
//=> { language: "javascript", code: "console.log('Hello, World!');" }
Generated using TypeDoc
Parse language and code content from a markdown code block.