showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.25k stars 1.56k forks source link

[Suggestion] Markdown to array of objects #991

Open indicozy opened 11 months ago

indicozy commented 11 months ago

Hi there!

I was using Showdown in Qwik (React-like framework) project, however, I need to convert html to JSX components. Is it possible to get from Showdown an array of HTML objects?

For example:

const markdown = "# Hi there!";
const json = converter.makeJSON(markdown);

Will result to:

{
frontmatter: {...some keys},
content: [{name: "h1", parameters: {classes: ["classNames"...], content: "Hi there!"}, {name: "h2", }}...]
}