Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

marked 12.0.0

A markdown parser built for speed
Package summary
Share
0
issues
0
licenses
Package created
24 Jul 2011
Version published
3 Feb 2024
Maintainers
4
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does marked do?

Marked is a powerful JavaScript library known for its speed and efficiency. It serves as a markdown parser, adept at translating Markdown syntax into HTML. Despite its lightweight nature, Marked manages to implement all markdown features from the supported flavors and specifications. Additionally, it displays great versatility as it can operate not only on a server or from a command line interface (CLI) but also in a browser.

How do you use marked?

To utilize the Marked library, installation is required and can be achieved by running the command npm install -g marked for a command-line interface, or npm install marked for in-browser installation. Once installed, marked can be used to parse markdown strings to HTML. However, it's crucial to remember that Marked does not sanitize the output HTML. As such, to prevent an XSS attack, use a sanitization library such as DOMPurify, sanitize-html, or insane on the output HTML. An example of usage includes:

In the browser, you should include the following JavaScript code:

<div id="content"></div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
  document.getElementById('content').innerHTML =
    marked.parse('# Marked in the browser\n\nRendered by **marked**.');
</script>

For a command-line interface, you may use:

marked -o hello.html
hello world
^D

At this point, hello.html will contain the parsed HTML - <p>hello world</p>.

Where are the marked docs?

Detailed information, guidelines, and additional resources about Marked are readily available on the official documentation site found at https://marked.js.org. The documentation provides comprehensive details about various options for advanced usage and extensibility of the Marked library at https://marked.js.org/#/USING_ADVANCED.md and https://marked.js.org/#/USING_PRO.md respectively.