@magic/transmute 0.0.46 → 0.0.50

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 CHANGED
@@ -241,7 +241,19 @@ update dependencies
241
241
  ##### 0.0.46
242
242
  update dependencies to avoid circular dependencies in @magic/types
243
243
 
244
- ##### 0.0.47 - unreleased
244
+ ##### 0.0.47
245
+ update dependencies
246
+
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 - unreleased
245
257
  ...
246
258
 
247
259
  [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.46",
3
+ "version": "0.0.50",
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.4",
39
- "@magic/cli": "0.0.33",
40
- "@magic/entities": "0.0.6",
38
+ "@magic/cases": "0.0.5",
39
+ "@magic/cli": "0.0.34",
40
+ "@magic/entities": "0.0.7",
41
41
  "@magic/log": "0.1.10",
42
42
  "@magic/types": "0.1.16",
43
- "marked": "2.1.3",
44
- "posthtml-parser": "0.9.0",
45
- "prettier": "2.3.2"
43
+ "marked": "4.0.6",
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.10",
52
- "@magic-themes/docs": "0.0.13",
53
- "@magic/core": "0.0.127",
54
- "@magic/format": "0.0.27",
55
- "@magic/test": "0.1.72"
51
+ "@magic-modules/pre": "0.0.11",
52
+ "@magic-themes/docs": "0.0.14",
53
+ "@magic/core": "0.0.132",
54
+ "@magic/format": "0.0.33",
55
+ "@magic/test": "0.1.77"
56
56
  },
57
57
  "keywords": [
58
58
  "magic",
package/src/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import marked from 'marked'
2
- import posthtmlParser from 'posthtml-parser'
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 marked from 'marked'
2
- import helpers from 'marked/src/helpers.js'
1
+ import { Renderer } from 'marked'
3
2
 
4
- const { escape } = helpers
3
+ export const markdown = new Renderer()
5
4
 
6
- export const markdown = new marked.Renderer()
5
+ /* overwrite builtin markdown functions to use @magic modules */
7
6
 
8
- markdown.code = (code, infostring, escaped) => {
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="${escape(href)}"`
24
+ let out = `<Link to="${href}"`
28
25
 
29
26
  if (title) {
30
27
  out += ` title="${title}"`