Skip to content

Commit 95090e6

Browse files
committed
fix: handle async rendering in MarkdownRenderer and update TypeScript config
1 parent eaf17c7 commit 95090e6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

custom/MarkdownRenderer.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
1414
if (!props.record[props.column.name]) return '-';
1515
const html = marked(String(props.record[props.column.name]));
16-
16+
if (html instanceof Promise) {
17+
console.error("Async rendering is not supported in this setup.");
18+
return '-';
19+
}
1720
return DOMPurify.sanitize(html);
1821
});
1922
</script>
2023

2124
<style lang="scss">
22-
2325
.mdwn h1 {
2426
@apply text-2xl font-bold mt-2 mb-2;
2527
}

custom/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"baseUrl": ".", // This should point to your project root
4+
"esModuleInterop": true,
45
"paths": {
56
"@/*": [
67
// "node_modules/adminforth/dist/spa/src/*"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adminforth/markdown",
3-
"version": "1.0.21",
3+
"version": "1.0.0",
44
"description": "Markdown plugin for adminforth",
55
"type": "module",
66
"main": "dist/index.js",
@@ -18,7 +18,7 @@
1818
"markdown"
1919
],
2020
"author": "devforth",
21-
"license": "ISC",
21+
"license": "MIT",
2222
"devDependencies": {
2323
"@types/node": "^22.10.7",
2424
"semantic-release": "^24.2.1",

0 commit comments

Comments
 (0)