@duetds/marked 2.0.33 → 2.0.34
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.d.ts +2 -2
- package/lib/index.js +5 -5
- package/package.json +13 -10
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Renderer } from "marked";
|
|
2
|
-
export
|
|
2
|
+
export type DuetMarkedOptions = {
|
|
3
3
|
isExternalUrl: (url: string) => boolean;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type DuetMarkedRenderer = Pick<Renderer, "heading" | "hr" | "list" | "paragraph" | "table" | "link">;
|
|
6
6
|
/**
|
|
7
7
|
* Creates a marked.js renderer that outputs Duet components
|
|
8
8
|
*/
|
package/lib/index.js
CHANGED
|
@@ -9,23 +9,23 @@ function createDuetMarkedRenderer(_a) {
|
|
|
9
9
|
var _b = _a === void 0 ? defaultOptions : _a, isExternalUrl = _b.isExternalUrl;
|
|
10
10
|
return {
|
|
11
11
|
heading: function (text, level) {
|
|
12
|
-
return "<duet-heading level=\"h"
|
|
12
|
+
return "<duet-heading level=\"h".concat(level, "\">").concat(text, "</duet-heading>");
|
|
13
13
|
},
|
|
14
14
|
hr: function () {
|
|
15
15
|
return "<duet-divider></duet-divider>";
|
|
16
16
|
},
|
|
17
17
|
list: function (body, ordered) {
|
|
18
18
|
var tag = ordered ? "ol" : "ul";
|
|
19
|
-
return "<"
|
|
19
|
+
return "<".concat(tag, " class=\"duet-list\">").concat(body, "</").concat(tag, ">");
|
|
20
20
|
},
|
|
21
21
|
paragraph: function (text) {
|
|
22
|
-
return "<duet-paragraph>"
|
|
22
|
+
return "<duet-paragraph>".concat(text, "</duet-paragraph>");
|
|
23
23
|
},
|
|
24
24
|
table: function (header, body) {
|
|
25
|
-
return "<duet-table><table><thead>"
|
|
25
|
+
return "<duet-table><table><thead>".concat(header, "</thead><tbody>").concat(body, "</tbody></table></duet-table>");
|
|
26
26
|
},
|
|
27
27
|
link: function (href, _title, text) {
|
|
28
|
-
return "<duet-link url=\""
|
|
28
|
+
return "<duet-link url=\"".concat(href, "\"").concat(isExternalUrl(href) ? " external" : "", ">").concat(text, "</duet-link>");
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duetds/marked",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.34",
|
|
4
4
|
"description": "This package includes Duet Markdown utilities and related tools.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "LocalTapiola Services Ltd <duetdesignsystem@lahitapiola.fi>",
|
|
@@ -66,15 +66,18 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@
|
|
70
|
-
"@
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"jest
|
|
69
|
+
"@babel/core": "7.21.0",
|
|
70
|
+
"@babel/preset-env": "7.20.2",
|
|
71
|
+
"@types/marked": "4.0.8",
|
|
72
|
+
"@typescript-eslint/parser": "5.54.0",
|
|
73
|
+
"babel-jest": "29.4.3",
|
|
74
|
+
"eslint": "8.35.0",
|
|
75
|
+
"jest": "29.4.3",
|
|
76
|
+
"jest-junit": "15.0.0",
|
|
74
77
|
"jest-serializer-html": "7.1.0",
|
|
75
|
-
"marked": "
|
|
76
|
-
"prettier": "2.4
|
|
77
|
-
"typescript": "4.
|
|
78
|
+
"marked": "4.2.12",
|
|
79
|
+
"prettier": "2.8.4",
|
|
80
|
+
"typescript": "4.9.5"
|
|
78
81
|
},
|
|
79
82
|
"peerDependencies": {
|
|
80
83
|
"marked": "3.0.7"
|
|
@@ -82,5 +85,5 @@
|
|
|
82
85
|
"publishConfig": {
|
|
83
86
|
"access": "public"
|
|
84
87
|
},
|
|
85
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "f05216ef1a1a119d41847cedbf77bec568ec03b6"
|
|
86
89
|
}
|