@duetds/marked 3.0.51 → 3.1.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.
Files changed (2) hide show
  1. package/lib/index.js +15 -20
  2. package/package.json +8 -8
package/lib/index.js CHANGED
@@ -1,32 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDuetMarkedRenderer = void 0;
4
- var defaultOptions = { isExternalUrl: function () { return false; } };
1
+ const defaultOptions = { isExternalUrl: () => false };
5
2
  /**
6
3
  * Creates a marked.js renderer that outputs Duet components
7
4
  */
8
- function createDuetMarkedRenderer(_a) {
9
- var _b = _a === void 0 ? defaultOptions : _a, isExternalUrl = _b.isExternalUrl;
5
+ export function createDuetMarkedRenderer({ isExternalUrl } = defaultOptions) {
10
6
  return {
11
- heading: function (text, level) {
12
- return "<duet-heading level=\"h".concat(level, "\">").concat(text, "</duet-heading>");
7
+ heading(text, level) {
8
+ return `<duet-heading level="h${level}">${text}</duet-heading>`;
13
9
  },
14
- hr: function () {
15
- return "<duet-divider></duet-divider>";
10
+ hr() {
11
+ return `<duet-divider></duet-divider>`;
16
12
  },
17
- list: function (body, ordered) {
18
- var tag = ordered ? "ol" : "ul";
19
- return "<".concat(tag, " class=\"duet-list\">").concat(body, "</").concat(tag, ">");
13
+ list(body, ordered) {
14
+ const tag = ordered ? "ol" : "ul";
15
+ return `<${tag} class="duet-list">${body}</${tag}>`;
20
16
  },
21
- paragraph: function (text) {
22
- return "<duet-paragraph>".concat(text, "</duet-paragraph>");
17
+ paragraph(text) {
18
+ return `<duet-paragraph>${text}</duet-paragraph>`;
23
19
  },
24
- table: function (header, body) {
25
- return "<duet-table><table><thead>".concat(header, "</thead><tbody>").concat(body, "</tbody></table></duet-table>");
20
+ table(header, body) {
21
+ return `<duet-table><table><thead>${header}</thead><tbody>${body}</tbody></table></duet-table>`;
26
22
  },
27
- link: function (href, _title, text) {
28
- return "<duet-link url=\"".concat(href, "\"").concat(isExternalUrl(href) ? " external" : "", ">").concat(text, "</duet-link>");
23
+ link(href, _title, text) {
24
+ return `<duet-link url="${href}"${isExternalUrl(href) ? " external" : ""}>${text}</duet-link>`;
29
25
  },
30
26
  };
31
27
  }
32
- exports.createDuetMarkedRenderer = createDuetMarkedRenderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duetds/marked",
3
- "version": "3.0.51",
3
+ "version": "3.1.1",
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>",
@@ -65,17 +65,17 @@
65
65
  ]
66
66
  },
67
67
  "devDependencies": {
68
- "@babel/core": "7.21.0",
69
- "@babel/preset-env": "7.20.2",
68
+ "@babel/core": "7.26.0",
69
+ "@babel/preset-env": "7.26.0",
70
70
  "@types/marked": "4.0.8",
71
- "@typescript-eslint/parser": "5.54.0",
72
- "babel-jest": "29.4.3",
73
- "eslint": "8.35.0",
71
+ "@typescript-eslint/parser": "8.14.0",
72
+ "babel-jest": "29.7.0",
73
+ "eslint": "9.14.0",
74
74
  "jest": "29.4.3",
75
75
  "jest-serializer-html": "7.1.0",
76
76
  "marked": "4.2.12",
77
77
  "prettier": "2.8.4",
78
- "typescript": "4.9.5"
78
+ "typescript": "5.5.4"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "marked": "3.0.7"
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "cb52b4d9fcf70d2289749fa3087b39ac1bb75df3"
86
+ "gitHead": "bbe7684184a2008db530309caf75609c3df856db"
87
87
  }