@khanacademy/simple-markdown 0.12.0 → 0.13.0
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 +10 -23
- package/dist/es/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
simple-markdown
|
|
2
|
-
===============
|
|
1
|
+
# @khanacademy/simple-markdown
|
|
3
2
|
|
|
4
3
|
simple-markdown is a markdown-like parser designed for simplicity
|
|
5
4
|
and extensibility.
|
|
6
5
|
|
|
7
|
-
Philosophy
|
|
8
|
-
----------
|
|
6
|
+
## Philosophy
|
|
9
7
|
|
|
10
8
|
Most markdown-like parsers aim for [speed][marked] or
|
|
11
9
|
[edge case handling][CommonMark].
|
|
@@ -31,15 +29,14 @@ simple-markdown is [MIT licensed][LICENSE].
|
|
|
31
29
|
|
|
32
30
|
[LICENSE]: https://github.com/Khan/perseus/blob/master/LICENSE
|
|
33
31
|
|
|
34
|
-
Getting started
|
|
35
|
-
---------------
|
|
32
|
+
## Getting started
|
|
36
33
|
|
|
37
34
|
First, let's parse and output some generic markdown using
|
|
38
35
|
simple-markdown.
|
|
39
36
|
|
|
40
37
|
If you want to run these examples in
|
|
41
|
-
node, you should run `
|
|
42
|
-
folder or `
|
|
38
|
+
node, you should run `yarn` in the simple-markdown
|
|
39
|
+
folder or `yarn add simple-markdown` in your project's
|
|
43
40
|
folder. Then you can acquire the `SimpleMarkdown` variable
|
|
44
41
|
with:
|
|
45
42
|
|
|
@@ -107,8 +104,7 @@ call `mdOutput`:
|
|
|
107
104
|
```
|
|
108
105
|
|
|
109
106
|
|
|
110
|
-
Adding a simple extension
|
|
111
|
-
-------------------------
|
|
107
|
+
## Adding a simple extension
|
|
112
108
|
|
|
113
109
|
Let's add an underline extension! To do this, we'll need to create
|
|
114
110
|
a new rule and then make a new parser/outputter. The next section
|
|
@@ -223,8 +219,7 @@ markdown with underlines!
|
|
|
223
219
|
```
|
|
224
220
|
|
|
225
221
|
|
|
226
|
-
Basic parsing/output API
|
|
227
|
-
------------------------
|
|
222
|
+
## Basic parsing/output API
|
|
228
223
|
|
|
229
224
|
#### `SimpleMarkdown.defaultBlockParse(source)`
|
|
230
225
|
|
|
@@ -250,8 +245,7 @@ Returns React-renderable output for `syntaxTree`.
|
|
|
250
245
|
*Note: raw html output will be coming soon*
|
|
251
246
|
|
|
252
247
|
|
|
253
|
-
Extension Overview
|
|
254
|
-
------------------
|
|
248
|
+
## Extension Overview
|
|
255
249
|
|
|
256
250
|
Elements in simple-markdown are generally created from rules.
|
|
257
251
|
For parsing, rules must specify `match` and `parse` methods.
|
|
@@ -367,8 +361,7 @@ The simple-markdown API contains several helper methods for
|
|
|
367
361
|
creating rules, as well as methods for creating parsers and
|
|
368
362
|
outputters from rules.
|
|
369
363
|
|
|
370
|
-
Extension API
|
|
371
|
-
-------------
|
|
364
|
+
## Extension API
|
|
372
365
|
|
|
373
366
|
simple-markdown includes access to the default list of rules,
|
|
374
367
|
as well as several functions to allow you to create parsers and
|
|
@@ -443,11 +436,5 @@ var blockParseAndOutput = function(source) {
|
|
|
443
436
|
};
|
|
444
437
|
```
|
|
445
438
|
|
|
446
|
-
|
|
447
|
-
--------------------------------
|
|
448
|
-
|
|
449
|
-
*Coming soon*
|
|
450
|
-
|
|
451
|
-
LICENSE
|
|
452
|
-
-------
|
|
439
|
+
## LICENSE
|
|
453
440
|
MIT. See the LICENSE file for text.
|
package/dist/es/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-core';
|
|
|
2
2
|
|
|
3
3
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
4
4
|
const libName = "@khanacademy/simple-markdown";
|
|
5
|
-
const libVersion = "0.
|
|
5
|
+
const libVersion = "0.13.0";
|
|
6
6
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
7
7
|
|
|
8
8
|
/* eslint-disable prefer-spread, no-regex-spaces, @typescript-eslint/no-unused-vars, guard-for-in, no-console, no-var */
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var perseusCore = require('@khanacademy/perseus-core');
|
|
|
6
6
|
|
|
7
7
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
8
8
|
const libName = "@khanacademy/simple-markdown";
|
|
9
|
-
const libVersion = "0.
|
|
9
|
+
const libVersion = "0.13.0";
|
|
10
10
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
11
11
|
|
|
12
12
|
/* eslint-disable prefer-spread, no-regex-spaces, @typescript-eslint/no-unused-vars, guard-for-in, no-console, no-var */
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Javascript markdown parsing, made simple",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.13.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@khanacademy/perseus-core": "1.
|
|
28
|
+
"@khanacademy/perseus-core": "1.5.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"perseus-build-settings": "^0.4.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"react": "
|
|
35
|
-
"react-dom": "
|
|
34
|
+
"react": ">= 18",
|
|
35
|
+
"react-dom": ">= 18"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"markdown"
|