marked 4.0.1 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/bin/marked.js +11 -5
- package/lib/marked.cjs +2288 -2289
- package/lib/marked.esm.js +13 -1
- package/lib/{marked.js → marked.umd.js} +8 -4
- package/marked.min.js +1 -1
- package/package.json +10 -10
- package/src/rules.js +13 -1
package/README.md
CHANGED
|
@@ -47,7 +47,9 @@ Also read about:
|
|
|
47
47
|
|
|
48
48
|
**CLI**
|
|
49
49
|
|
|
50
|
+
|
|
50
51
|
``` bash
|
|
52
|
+
# Example with stdin input
|
|
51
53
|
$ marked -o hello.html
|
|
52
54
|
hello world
|
|
53
55
|
^D
|
|
@@ -55,6 +57,11 @@ $ cat hello.html
|
|
|
55
57
|
<p>hello world</p>
|
|
56
58
|
```
|
|
57
59
|
|
|
60
|
+
```bash
|
|
61
|
+
# Print all options
|
|
62
|
+
$ marked --help
|
|
63
|
+
```
|
|
64
|
+
|
|
58
65
|
**Browser**
|
|
59
66
|
|
|
60
67
|
```html
|
package/bin/marked.js
CHANGED
|
@@ -27,10 +27,16 @@ async function help() {
|
|
|
27
27
|
const { dirname, resolve } = await import('path');
|
|
28
28
|
const { fileURLToPath } = await import('url');
|
|
29
29
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
const helpText = await readFile(resolve(__dirname, '../man/marked.1.txt'), 'utf8');
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line promise/param-names
|
|
33
|
+
await new Promise(res => {
|
|
34
|
+
spawn('man', [resolve(__dirname, '../man/marked.1')], options)
|
|
35
|
+
.on('error', () => {
|
|
36
|
+
console.log(helpText);
|
|
37
|
+
})
|
|
38
|
+
.on('close', res);
|
|
39
|
+
});
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
async function version() {
|
|
@@ -149,7 +155,7 @@ async function main(argv) {
|
|
|
149
155
|
: marked(data, options);
|
|
150
156
|
|
|
151
157
|
if (output) {
|
|
152
|
-
return await writeFile(output,
|
|
158
|
+
return await writeFile(output, html);
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
process.stdout.write(html + '\n');
|