@milkdown/preset-commonmark 7.6.2 → 7.6.4
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 +1 -1
- package/lib/index.es.js +1367 -1120
- package/lib/index.es.js.map +1 -1
- package/lib/node/heading.d.ts.map +1 -1
- package/package.json +7 -8
- package/src/node/heading.ts +5 -2
- package/src/node/list-item.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/node/heading.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/node/heading.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAgBjD,iBAAS,yBAAyB,CAAC,IAAI,EAAE,IAAI,UAM5C;AAID,eAAO,MAAM,kBAAkB,wFAG9B,CAAA;AAQD,eAAO,MAAM,WAAW,qCAAuB,CAAA;AAQ/C,eAAO,MAAM,aAAa,kDAkDxB,CAAA;AAcF,eAAO,MAAM,sBAAsB,sCAmBjC,CAAA;AAUF,eAAO,MAAM,oBAAoB,4CAQ/B,CAAA;AAUF,eAAO,MAAM,uBAAuB,6CAwBnC,CAAA;AAUD,eAAO,MAAM,aAAa,sKAkDxB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkdown/preset-commonmark",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.6.
|
|
4
|
+
"version": "7.6.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -33,18 +33,17 @@
|
|
|
33
33
|
"@milkdown/transformer": "^7.2.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sindresorhus/slugify": "^2.2.0",
|
|
37
36
|
"remark-inline-links": "^7.0.0",
|
|
38
37
|
"tslib": "^2.8.1",
|
|
39
38
|
"unist-util-visit": "^5.0.0",
|
|
40
|
-
"@milkdown/exception": "7.6.
|
|
41
|
-
"@milkdown/utils": "7.6.
|
|
39
|
+
"@milkdown/exception": "7.6.4",
|
|
40
|
+
"@milkdown/utils": "7.6.4"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@milkdown/core": "7.6.
|
|
45
|
-
"@milkdown/ctx": "7.6.
|
|
46
|
-
"@milkdown/prose": "7.6.
|
|
47
|
-
"@milkdown/transformer": "7.6.
|
|
43
|
+
"@milkdown/core": "7.6.4",
|
|
44
|
+
"@milkdown/ctx": "7.6.4",
|
|
45
|
+
"@milkdown/prose": "7.6.4",
|
|
46
|
+
"@milkdown/transformer": "7.6.4"
|
|
48
47
|
},
|
|
49
48
|
"nx": {
|
|
50
49
|
"targets": {
|
package/src/node/heading.ts
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
$nodeSchema,
|
|
12
12
|
$useKeymap,
|
|
13
13
|
} from '@milkdown/utils'
|
|
14
|
-
import slugify from '@sindresorhus/slugify'
|
|
15
14
|
import { serializeText, withMeta } from '../__internal__'
|
|
16
15
|
import { paragraphSchema } from './paragraph'
|
|
17
16
|
|
|
@@ -20,7 +19,11 @@ const headingIndex = Array(6)
|
|
|
20
19
|
.map((_, i) => i + 1)
|
|
21
20
|
|
|
22
21
|
function defaultHeadingIdGenerator(node: Node) {
|
|
23
|
-
return
|
|
22
|
+
return node.textContent
|
|
23
|
+
.toLowerCase()
|
|
24
|
+
.trim()
|
|
25
|
+
.replace(/[^\w\s-]/g, '')
|
|
26
|
+
.replace(/\s+/g, '-')
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
/// This is a slice contains a function to generate heading id.
|
package/src/node/list-item.ts
CHANGED
|
@@ -21,7 +21,7 @@ withMeta(listItemAttr, {
|
|
|
21
21
|
/// Schema for list item node.
|
|
22
22
|
export const listItemSchema = $nodeSchema('list_item', (ctx) => ({
|
|
23
23
|
group: 'listItem',
|
|
24
|
-
content: '
|
|
24
|
+
content: 'paragraph block*',
|
|
25
25
|
attrs: {
|
|
26
26
|
label: {
|
|
27
27
|
default: '•',
|