
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@jwerre/markdown_to_array
Advanced tools
Convert markdown text to a simplified DOM array. Previously markdown_to_html
Convert markdown text to a simplified DOM array.
npm install --save @jwerre/markdown_to_array
@jwerre/markdown_to_array instead of markdown_to_array
MdToArray = require('markdown_to_array')
const md = `\
This is *italics* and this is **bold**.
- list item 1
- list item 2
- list item 3
Here is a [hyperlink](https://example.com)!
Here are some **images**: 
`;
const mdDom = new MdToArray(md);
const parsed = mdDom.parse();
console.log(parsed);
[
[
{ text: 'This is ', tag: 'P', P: true },
{ text: 'italics', tag: 'EM', EM: true },
{ text: ' and this is ', tag: 'P', P: true },
{ text: 'bold', tag: 'STRONG', STRONG: true },
{ text: '.', tag: 'P', P: true }
],
[
{ text: 'list item 1', tag: 'LI', LI: true },
{ text: 'list item 2', tag: 'LI', LI: true },
{ text: 'list item 3', tag: 'LI', LI: true }
],
[
{ text: 'Here is a ', tag: 'P', P: true },
{
text: 'hyperlink',
tag: 'A',
A: true,
href: 'https://example.com'
},
{ text: '!', tag: 'P', P: true }
],
[
{ text: 'Here are some ', tag: 'P', P: true },
{ text: 'images', tag: 'STRONG', STRONG: true },
{ text: ': ', tag: 'P', P: true },
{
tag: 'IMG',
IMG: true,
src: 'https://example.com/img1.png',
alt: 'some alt text'
}
],
[
{
tag: 'IMG',
IMG: true,
src: 'https://example.com/img2.png',
alt: ''
}
]
]
FAQs
Convert markdown text to a simplified DOM array. Previously markdown_to_html
We found that @jwerre/markdown_to_array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.