
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@create-markdown/preview
Advanced tools
Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams
Framework-agnostic HTML rendering for @create-markdown with syntax highlighting (Shiki) and diagram support (Mermaid).
# Using bun
bun add @create-markdown/preview
# Using npm
npm install @create-markdown/preview
# Optional: Install plugins
npm install shiki mermaid
import { markdownToHTML } from '@create-markdown/preview';
const html = markdownToHTML(`
# Hello World
This is **bold** and *italic* text.
`);
document.getElementById('preview').innerHTML = html;
import { renderAsync, shikiPlugin } from '@create-markdown/preview';
import { parse } from '@create-markdown/core';
const blocks = parse(`
\`\`\`typescript
const greeting = "Hello, World!";
console.log(greeting);
\`\`\`
`);
const html = await renderAsync(blocks, {
plugins: [shikiPlugin({ theme: 'github-dark' })],
});
import { renderAsync, mermaidPlugin } from '@create-markdown/preview';
import { parse } from '@create-markdown/core';
const blocks = parse(`
\`\`\`mermaid
flowchart LR
A[Start] --> B[Process]
B --> C[End]
\`\`\`
`);
const html = await renderAsync(blocks, {
plugins: [mermaidPlugin({ theme: 'default' })],
});
<script type="module">
import { registerPreviewElement } from '@create-markdown/preview';
registerPreviewElement();
</script>
<markdown-preview theme="github">
# Hello World
This is rendered as HTML automatically!
</markdown-preview>
With plugins:
import { registerPreviewElement, shikiPlugin, mermaidPlugin } from '@create-markdown/preview';
registerPreviewElement({
plugins: [
shikiPlugin(),
mermaidPlugin(),
],
});
blocksToHTML(blocks, options?)Converts blocks to HTML string synchronously.
markdownToHTML(markdown, options?)Converts markdown string to HTML.
renderAsync(blocks, options?)Async version that initializes plugins before rendering.
shikiPlugin(options?) - Syntax highlighting with ShikimermaidPlugin(options?) - Mermaid diagram renderingCSS themes are available at:
@create-markdown/preview/themes/github.css@create-markdown/preview/themes/github-dark.css@create-markdown/preview/themes/minimal.cssinterface PreviewOptions {
classPrefix?: string; // CSS class prefix (default: 'cm-')
theme?: string; // Theme name
linkTarget?: '_blank' | '_self';
sanitize?: boolean; // Sanitize HTML output
plugins?: PreviewPlugin[]; // Plugins for enhanced rendering
}
MIT
FAQs
Framework-agnostic HTML rendering for @create-markdown with optional syntax highlighting
The npm package @create-markdown/preview receives a total of 653,983 weekly downloads. As such, @create-markdown/preview popularity was classified as popular.
We found that @create-markdown/preview demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.