
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Quikdown is a small, secure markdown parser with bidirectional conversion. Zero dependencies, XSS protection built-in, extensible via plugins for code highlighting and diagrams, and works in browser and Node.js.
For small and fast projects quikdown includes built-in inline styles for a "batteries included" rendering experience, but these can be overridden with themed css (see light and dark examples).
🚀 Live Demo | Editor Demo | Documentation
📍 Quick Links: Installation • Quick Start • API • TypeScript • Plugins • Examples
Quikdown is available via NPM and related unpkg and jsdelivr
npm install quikdown
CDN (ES Modules):
<script type="module">
import quikdown from 'https://unpkg.com/quikdown/dist/quikdown.esm.min.js';
document.body.innerHTML = quikdown('# Hello World');
</script>
CDN (UMD):
<script src="https://unpkg.com/quikdown/dist/quikdown.umd.min.js"></script>
<script>
document.body.innerHTML = quikdown('# Hello World');
</script>
Quikdown is built in 3 versions. The smallest (quikdown) provides markdown to html conversion only. The next (quikdown_bd) provides markdown to html and html to markdown support. The lightweight editor quikdown_edit allows a bidirectional editor with lazy loading for common fences such as codeblocks, svg, and mermaid diagrams is also provided.
// Basic conversion
const html = quikdown('# Hello World',
{inline_styles: true} // Use inline styles, more options in API docs
);
document.body.innerHTML = html;
// Convert with source tracking
const htmlString = quikdown_bd(markdown, options);
// Convert HTML back to Markdown
const markdown = quikdown_bd.toMarkdown(htmlString);
Note: quikdown does not provide a generic html to markdown conversion but uses special tags and limited DOM parsing for HTML to markdown conversion. Standard markdown components such as headings, text styles, tables, quotes, etc are supported. For custom fences quikdown relies on its tag system or 3rd party handlers to provide reverse (html to md) conversion.
const editor = new QuikdownEditor('#container', {
mode: 'split', // 'source', 'split', 'preview'
theme: 'auto', // 'light', 'dark', 'auto'
plugins: { highlightjs: true, mermaid: true } // built-in fence handlers, see API docs for custom plugins
});
editor.setMarkdown('# Content \nTo be quik or not to be.'); // provide default content
const content = editor.getMarkdown(); // get source content, see APIs for getting / setting HTML
quikdown supports built-in styles for a "batteries included" experience or you can bring your own CSS themes. Example css files are provided for basic light and dark themes to get started.
const html = quikdown(markdown, {
lazy_linefeeds: true, // Single newlines become <br>
inline_styles: false, // Use class based CSS instead of inline styles
fence_plugin: { // Custom code block processor (v1.1.0+ API)
render: myHandler // Function to render fence blocks
}
});
Inline styles: All formatting uses inline CSS
quikdown('**bold**', { inline_styles: true });
// <strong style="font-weight: bold;">bold</strong>
Class-based styling: Uses CSS classes (default)
quikdown('**bold**');
// <strong>bold</strong>
// Requires CSS: .quikdown strong { font-weight: bold; }
// see included dist/quikdown.light.css or quikdown.dark.css
Quikdown provides a callback for all fenced text such as code blocks, math, svg etc.
Handle code blocks with custom languages:
const fencePlugin = {
render: (code, language) => {
if (language === 'mermaid') {
// Process with mermaid library and return rendered diagram
const id = 'mermaid-' + Math.random().toString(36).substr(2, 9);
setTimeout(() => mermaid.render(id + '-svg', code).then(result => {
document.getElementById(id).innerHTML = result.svg;
}), 0);
return `<div id="${id}" class="mermaid">Loading diagram...</div>`;
}
// Return undefined for default handling
}
};
const html = quikdown(markdown, { fence_plugin: fencePlugin });
quikdown includes TypeScript definitions for better IDE support and type safety:
import quikdown, { QuikdownOptions, FencePlugin } from 'quikdown';
const fencePlugin: FencePlugin = {
render: (content: string, language: string) => {
return `<pre class="hljs ${language}">${content}</pre>`;
}
};
const options: QuikdownOptions = {
inline_styles: true,
fence_plugin: fencePlugin
};
const html: string = quikdown(markdown, options);
Text formatting: **bold**
, *italic*
, ~~strikethrough~~
, `code`
Headings: # H1
through ###### H6
Lists:
Links: [text](url)
and automatic URL detection
Code blocks:
console.log('syntax highlighting support via plugins');
Tables, blockquotes, horizontal rules - See documentation for complete syntax reference
For complete API documentation, see docs/api-reference.md
All HTML is escaped by default. Only safe markdown constructs become HTML:
const unsafe = '<script>alert("XSS")</script> **bold**';
const safe = quikdown(unsafe);
// <script>alert("XSS")</script> <strong>bold</strong>
Works with React, Vue, Svelte, Angular. See Framework Integration Guide for examples.
For size and security, quikdown doesn't support:
Note that raw html, svg, etc can be rendered using appropriate fences
<h1>My HTML Content</h1>
<p>Some HTML</p>
as long as an appropriate fence plugin is provided. See API docs for example or try out in quikdown_edit.js which has built-in support for HTML with XSS prevention.
BSD 2-Clause - see LICENSE.txt
FAQs
quikdown is a simple markdown to HTML parser that supports fences
The npm package quikdown receives a total of 108 weekly downloads. As such, quikdown popularity was classified as not popular.
We found that quikdown 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.