Split Markdown text into typed sections for platform-specific formatting.
Handles:
...
#
##
###
Raw Markdown text from an agent response.
Array of sections with type and content.
const sections = splitMarkdownIntoSections('# Title\n\nSome text\n\n```js\nconsole.log("hi")\n```');// [// { Type: 'header', Content: 'Title' },// { Type: 'text', Content: 'Some text' },// { Type: 'code', Content: 'console.log("hi")' }// ] Copy
const sections = splitMarkdownIntoSections('# Title\n\nSome text\n\n```js\nconsole.log("hi")\n```');// [// { Type: 'header', Content: 'Title' },// { Type: 'text', Content: 'Some text' },// { Type: 'code', Content: 'console.log("hi")' }// ]
Split Markdown text into typed sections for platform-specific formatting.
Handles:
...)#,##,###)