@magic/transmute 0.0.47 → 0.0.51
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 +13 -1
- package/package.json +14 -14
- package/src/index.mjs +2 -4
- package/src/renderers/markdown.mjs +5 -8
package/README.md
CHANGED
|
@@ -244,7 +244,19 @@ update dependencies to avoid circular dependencies in @magic/types
|
|
|
244
244
|
##### 0.0.47
|
|
245
245
|
update dependencies
|
|
246
246
|
|
|
247
|
-
##### 0.0.48
|
|
247
|
+
##### 0.0.48
|
|
248
|
+
update dependencies
|
|
249
|
+
|
|
250
|
+
##### 0.0.49
|
|
251
|
+
update dependencies
|
|
252
|
+
|
|
253
|
+
##### 0.0.50
|
|
254
|
+
update dependencies
|
|
255
|
+
|
|
256
|
+
##### 0.0.51
|
|
257
|
+
update dependencies
|
|
258
|
+
|
|
259
|
+
##### 0.0.52 - unreleased
|
|
248
260
|
...
|
|
249
261
|
|
|
250
262
|
[npm-image]: https://img.shields.io/npm/v/@magic/transmute.svg
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic/transmute",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"author": "Wizards & Witches",
|
|
5
5
|
"homepage": "https://magic.github.io/transmute",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -35,24 +35,24 @@
|
|
|
35
35
|
"calls": "calls"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@magic/cases": "0.0.
|
|
39
|
-
"@magic/cli": "0.0.
|
|
40
|
-
"@magic/entities": "0.0.
|
|
41
|
-
"@magic/log": "0.1.
|
|
42
|
-
"@magic/types": "0.1.
|
|
43
|
-
"marked": "
|
|
44
|
-
"posthtml-parser": "0.
|
|
45
|
-
"prettier": "2.
|
|
38
|
+
"@magic/cases": "0.0.6",
|
|
39
|
+
"@magic/cli": "0.0.38",
|
|
40
|
+
"@magic/entities": "0.0.8",
|
|
41
|
+
"@magic/log": "0.1.13",
|
|
42
|
+
"@magic/types": "0.1.18",
|
|
43
|
+
"marked": "4.0.8",
|
|
44
|
+
"posthtml-parser": "0.10.1",
|
|
45
|
+
"prettier": "2.5.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@magic-modules/git-badges": "0.0.11",
|
|
49
49
|
"@magic-modules/light-switch": "0.0.10",
|
|
50
50
|
"@magic-modules/no-spy": "0.0.6",
|
|
51
|
-
"@magic-modules/pre": "0.0.
|
|
52
|
-
"@magic-themes/docs": "0.0.
|
|
53
|
-
"@magic/core": "0.0.
|
|
54
|
-
"@magic/format": "0.0.
|
|
55
|
-
"@magic/test": "0.
|
|
51
|
+
"@magic-modules/pre": "0.0.11",
|
|
52
|
+
"@magic-themes/docs": "0.0.14",
|
|
53
|
+
"@magic/core": "0.0.133",
|
|
54
|
+
"@magic/format": "0.0.36",
|
|
55
|
+
"@magic/test": "0.2.2"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"magic",
|
package/src/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import marked from 'marked'
|
|
2
|
-
import
|
|
1
|
+
import { marked } from 'marked'
|
|
2
|
+
import { parser } from 'posthtml-parser'
|
|
3
3
|
|
|
4
4
|
import is from '@magic/types'
|
|
5
5
|
|
|
@@ -42,8 +42,6 @@ export const html = (string, state = {}, originalState = {}) => {
|
|
|
42
42
|
|
|
43
43
|
const implanted = implantState({ input: string, state })
|
|
44
44
|
|
|
45
|
-
const parser = posthtmlParser.default ? posthtmlParser.default : posthtmlParser
|
|
46
|
-
|
|
47
45
|
const ast = parser(implanted)
|
|
48
46
|
|
|
49
47
|
const out = renderers.html(ast)
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import helpers from 'marked/src/helpers.js'
|
|
1
|
+
import { Renderer } from 'marked'
|
|
3
2
|
|
|
4
|
-
const
|
|
3
|
+
export const markdown = new Renderer()
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
/* overwrite builtin markdown functions to use @magic modules */
|
|
7
6
|
|
|
8
|
-
markdown.code = (code, infostring
|
|
7
|
+
markdown.code = (code, infostring) => {
|
|
9
8
|
let lang = (infostring || '').match(/\S*/)[0]
|
|
10
9
|
|
|
11
10
|
if (!lang) {
|
|
12
11
|
return `<Pre>${code}</Pre>\n`
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
lang = escape(lang, true)
|
|
16
|
-
|
|
17
14
|
return `<Pre class="${lang}">${code}</Pre>`
|
|
18
15
|
}
|
|
19
16
|
|
|
@@ -24,7 +21,7 @@ markdown.link = (href, title, text) => {
|
|
|
24
21
|
return text
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
let out = `<Link to="${
|
|
24
|
+
let out = `<Link to="${href}"`
|
|
28
25
|
|
|
29
26
|
if (title) {
|
|
30
27
|
out += ` title="${title}"`
|