Get started with markdown-it CDN

MIT licensed

Markdown-it is a popular and efficient Markdown parser for JS.

Tags:
  • markdown
  • parser
  • commonmark
  • markdown-it
  • markdown-it-plugin

Stable version

Copied!

How to start using markdown-it CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with markdown-it CDN - cdnhub.io</title>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/markdown-it.min.js"></script>
    <style>
        pre code {
            background: transparent;
            border: none;
            padding: 0;
            margin: 0;
        }
    </style>
</head>
<body>
    <div id="container"></div>
    <script>
        const markdownIt = require('markdown-it')();
        const container = document.getElementById('container');

        const markdownText = `
# Heading 1
## Heading 2
### Heading 3

**Bold text**

`;

        const rendered = markdownIt.render(markdownText);
        container.innerHTML = rendered;
    </script>
</body>
</html>

All versions