@mzebley/mark-down 1.1.0 → 1.2.1
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 +11 -6
- package/src/index.ts +2 -0
- package/src/markdown.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mzebley/mark-down",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "mark↓ core runtime and shared utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,23 +10,28 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.js"
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
14
15
|
},
|
|
15
16
|
"./slug": {
|
|
16
17
|
"types": "./dist/slug.d.ts",
|
|
17
|
-
"import": "./dist/slug.js"
|
|
18
|
+
"import": "./dist/slug.js",
|
|
19
|
+
"default": "./dist/slug.js"
|
|
18
20
|
},
|
|
19
21
|
"./browser": {
|
|
20
22
|
"types": "./dist/browser.d.ts",
|
|
21
|
-
"import": "./dist/browser.js"
|
|
23
|
+
"import": "./dist/browser.js",
|
|
24
|
+
"default": "./dist/browser.js"
|
|
22
25
|
},
|
|
23
26
|
"./inline": {
|
|
24
27
|
"types": "./dist/inline.d.ts",
|
|
25
|
-
"import": "./dist/inline.js"
|
|
28
|
+
"import": "./dist/inline.js",
|
|
29
|
+
"default": "./dist/inline.js"
|
|
26
30
|
},
|
|
27
31
|
"./angular": {
|
|
28
32
|
"types": "./dist/angular/index.d.ts",
|
|
29
|
-
"import": "./dist/angular/index.js"
|
|
33
|
+
"import": "./dist/angular/index.js",
|
|
34
|
+
"default": "./dist/angular/index.js"
|
|
30
35
|
}
|
|
31
36
|
},
|
|
32
37
|
"scripts": {
|
package/src/index.ts
CHANGED
package/src/markdown.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { marked } from "marked";
|
|
2
2
|
|
|
3
3
|
export function renderMarkdown(markdown: string): string {
|
|
4
|
-
|
|
4
|
+
const html = marked.parse(markdown);
|
|
5
|
+
|
|
6
|
+
if (typeof html === "string") {
|
|
7
|
+
return html;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
throw new Error("renderMarkdown unexpectedly returned a Promise");
|
|
5
11
|
}
|