lwl | Less with links. |
| download: http://git.y1.nz/archives/lwl.tar.gz | |
| README | Files | Log | Refs |
test/10
1 <a href="https://marked.js.org">
2 <img width="60px" height="60px" src="https://marked.js.org/img/logo-black.svg" align="right" />
3 </a>
4
5 # Marked
6
7 [](https://www.npmjs.com/package/marked)
8 [](https://packagephobia.now.sh/result?p=marked)
9 [](https://www.npmjs.com/package/marked)
10 [](https://github.com/markedjs/marked/actions)
11 [](https://snyk.io/test/npm/marked)
12
13 - ⚡ built for speed
14 - ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
15 - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
16 - 🌐 works in a browser, on a server, or from a command line interface (CLI)
17
18 ## Demo
19
20 Check out the [demo page](https://marked.js.org/demo/) to see Marked in action ⛹️
21
22 ## Docs
23
24 Our [documentation pages](https://marked.js.org) are also rendered using marked 💯
25
26 Also read about:
27
28 * [Options](https://marked.js.org/using_advanced)
29 * [Extensibility](https://marked.js.org/using_pro)
30
31 ## Compatibility
32
33 **Node.js:** Only [current and LTS](https://nodejs.org/en/about/releases/) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
34
35 **Browser:** [Baseline Widely Available](https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility)
36
37 ## Installation
38
39 **CLI:**
40
41 ```sh
42 npm install -g marked
43 ```
44
45 **In-browser:**
46
47 ```sh
48 npm install marked
49 ```
50
51 ## Usage
52
53 ### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨
54
55 ```
56 DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`));
57 ```
58
59 **CLI**
60
61 ``` bash
62 # Example with stdin input
63 $ marked -o hello.html
64 hello world
65 ^D
66 $ cat hello.html
67 <p>hello world</p>
68 ```
69
70 ```bash
71 # Print all options
72 $ marked --help
73 ```
74
75 **Node.js**
76
77 ```js
78 import { marked } from 'marked';
79 const html = marked.parse('# Marked in Node.js');
80 console.log(html);
81 ```
82
83 **Browser**
84
85 ```html
86 <!doctype html>
87 <html>
88 <head>
89 <meta charset="utf-8"/>
90 <title>Marked in the browser</title>
91 </head>
92 <body>
93 <div id="content"></div>
94 <script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
95 <script>
96 document.getElementById('content').innerHTML =
97 marked.parse('# Marked in the browser\n\nRendered by **marked**.');
98 </script>
99 </body>
100 </html>
101 ```
102 or import esm module
103
104 ```html
105 <script type="module">
106 import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
107 document.getElementById('content').innerHTML =
108 marked.parse('# Marked in the browser\n\nRendered by **marked**.');
109 </script>
110 ```
111
112 ## License
113
114 Copyright (c) 2018+, MarkedJS. (MIT License)
115 Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.