@milkdown/preset-commonmark 7.4.0 → 7.5.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/lib/index.es.js +156 -155
- package/lib/index.es.js.map +1 -1
- package/lib/node/hardbreak.d.ts.map +1 -1
- package/lib/plugin/sync-heading-id-plugin.d.ts.map +1 -1
- package/package.json +10 -16
- package/src/node/hardbreak.ts +3 -2
- package/src/node/html.ts +1 -1
- package/src/plugin/sync-heading-id-plugin.ts +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardbreak.d.ts","sourceRoot":"","sources":["../../src/node/hardbreak.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"hardbreak.d.ts","sourceRoot":"","sources":["../../src/node/hardbreak.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa,qCAKxB,CAAA;AAQF,eAAO,MAAM,eAAe,oDA4BzB,CAAA;AAaH,eAAO,MAAM,sBAAsB,6CAoBjC,CAAA;AASF,eAAO,MAAM,eAAe,6EAQ1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-heading-id-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/sync-heading-id-plugin.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"sync-heading-id-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/sync-heading-id-plugin.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,kCAgD9B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkdown/preset-commonmark",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/Milkdown/milkdown.git",
|
|
9
|
-
"directory": "packages/preset-commonmark"
|
|
9
|
+
"directory": "packages/plugins/preset-commonmark"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"milkdown",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"remark-inline-links": "^7.0.0",
|
|
38
38
|
"tslib": "^2.5.0",
|
|
39
39
|
"unist-util-visit": "^5.0.0",
|
|
40
|
-
"@milkdown/exception": "7.
|
|
41
|
-
"@milkdown/utils": "7.
|
|
40
|
+
"@milkdown/exception": "7.5.0",
|
|
41
|
+
"@milkdown/utils": "7.5.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@milkdown/core": "7.
|
|
45
|
-
"@milkdown/ctx": "7.
|
|
46
|
-
"@milkdown/prose": "7.
|
|
47
|
-
"@milkdown/transformer": "7.
|
|
44
|
+
"@milkdown/core": "7.5.0",
|
|
45
|
+
"@milkdown/ctx": "7.5.0",
|
|
46
|
+
"@milkdown/prose": "7.5.0",
|
|
47
|
+
"@milkdown/transformer": "7.5.0"
|
|
48
48
|
},
|
|
49
49
|
"nx": {
|
|
50
50
|
"targets": {
|
|
@@ -53,19 +53,13 @@
|
|
|
53
53
|
"{projectRoot}/lib"
|
|
54
54
|
],
|
|
55
55
|
"dependsOn": [
|
|
56
|
-
|
|
57
|
-
"target": "build",
|
|
58
|
-
"projects": "dependencies"
|
|
59
|
-
}
|
|
56
|
+
"build"
|
|
60
57
|
]
|
|
61
58
|
},
|
|
62
59
|
"tsc": {
|
|
63
60
|
"outputs": [],
|
|
64
61
|
"dependsOn": [
|
|
65
|
-
|
|
66
|
-
"target": "build",
|
|
67
|
-
"projects": "dependencies"
|
|
68
|
-
}
|
|
62
|
+
"build"
|
|
69
63
|
]
|
|
70
64
|
}
|
|
71
65
|
}
|
package/src/node/hardbreak.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { withMeta } from '../__internal__'
|
|
|
9
9
|
/// - `data-is-inline` - Whether the hardbreak is inline.
|
|
10
10
|
export const hardbreakAttr = $nodeAttr('hardbreak', (node) => {
|
|
11
11
|
return {
|
|
12
|
+
'data-type': 'hardbreak',
|
|
12
13
|
'data-is-inline': node.attrs.isInline,
|
|
13
14
|
}
|
|
14
15
|
})
|
|
@@ -28,8 +29,8 @@ export const hardbreakSchema = $nodeSchema('hardbreak', ctx => ({
|
|
|
28
29
|
},
|
|
29
30
|
},
|
|
30
31
|
selectable: false,
|
|
31
|
-
parseDOM: [{ tag: 'br' }],
|
|
32
|
-
toDOM: node => ['br', ctx.get(hardbreakAttr.key)(node)],
|
|
32
|
+
parseDOM: [{ tag: 'br' }, { tag: 'span[data-type="hardbreak"]', getAttrs: () => ({ isInline: true }) }],
|
|
33
|
+
toDOM: node => node.attrs.isInline ? ['span', ctx.get(hardbreakAttr.key)(node), ' '] : ['br', ctx.get(hardbreakAttr.key)(node)],
|
|
33
34
|
parseMarkdown: {
|
|
34
35
|
match: ({ type }) => type === 'break',
|
|
35
36
|
runner: (state, node, type) => {
|
package/src/node/html.ts
CHANGED