van-mdx 0.5.0 → 0.7.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "van-mdx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Markdown preprocessor for Vanjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -16,16 +16,28 @@
|
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
".": "./src/index.js",
|
|
19
|
-
"
|
|
19
|
+
"./loaders/*": "./src/loaders/*/index.js",
|
|
20
|
+
"./components/*":"./src/components/*.js",
|
|
21
|
+
"./components":"./src/components/index.js",
|
|
22
|
+
|
|
20
23
|
"./astro": "./src/bundlers/astro/index.js",
|
|
21
24
|
"./astro/entry-client": "./src/bundlers/astro/entry-client.js",
|
|
22
25
|
"./astro/entry-server": "./src/bundlers/astro/entry-server.js"
|
|
23
26
|
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/zakarialaoui10/van-mdx.git"
|
|
30
|
+
},
|
|
24
31
|
"author": "zakaria elalaoui",
|
|
25
32
|
"license": "MIT",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/zakarialaoui10/van-mdx/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/zakarialaoui10/van-mdx#readme",
|
|
26
37
|
"dependencies": {
|
|
27
|
-
"mdzjs": "^0.
|
|
38
|
+
"mdzjs": "^0.17.0",
|
|
28
39
|
"vanjs-core": "^1.6.0",
|
|
29
|
-
"
|
|
40
|
+
"zextra": "^0.15.1",
|
|
41
|
+
"ziko": "^0.65.0"
|
|
30
42
|
}
|
|
31
43
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-of-contents.js'
|
package/src/transpiler/index.js
CHANGED
|
@@ -13,8 +13,8 @@ const transpileMD = async (Markdown, {plugins = []} = {})=>{
|
|
|
13
13
|
|
|
14
14
|
const body = [
|
|
15
15
|
"import van from 'vanjs-core'",
|
|
16
|
-
"import {HTMLWrapper as _HTMLWrapper} from 'ziko/ui'",
|
|
17
|
-
"const HTMLWrapper = (html) => _HTMLWrapper(html).element",
|
|
16
|
+
hasCode ?? "import {HTMLWrapper as _HTMLWrapper} from 'ziko/ui';",
|
|
17
|
+
hasCode ?? "const HTMLWrapper = (html) => _HTMLWrapper(html).element;",
|
|
18
18
|
...esm,
|
|
19
19
|
transformeAttrs(attrs),
|
|
20
20
|
`export default (${stringifyProps(props)})=>{`,
|
|
@@ -26,7 +26,7 @@ const transpileMD = async (Markdown, {plugins = []} = {})=>{
|
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
// if(hasCode) body.unshift(`import("highlight.js/styles/${CodeStyle}.css")`);
|
|
29
|
-
return body.join("\n");
|
|
29
|
+
return body.filter(Boolean).join("\n");
|
|
30
30
|
}
|
|
31
31
|
export{
|
|
32
32
|
transpileMD
|