Skip to content

Commit 5987cc2

Browse files
fix(my): add markdown text (#280)
1 parent faea534 commit 5987cc2

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

app/pages/category/[slug].vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99

1010
<div class="flex flex-col">
1111
<span class="bg-blue-ic self-start px-4 py-3 font-bold">Description</span>
12-
<div class="max-w-[50rem] border border-white p-4">
13-
{{ data?.shortDescription }}
14-
</div>
12+
<div
13+
class="mardown max-w-[50rem] border border-white p-4"
14+
v-html="description"></div>
1515
</div>
1616
</div>
1717
</template>
1818

1919
<script setup lang="ts">
2020
import type { Category } from '#shared/types';
21+
import { marked } from 'marked';
2122
2223
// Get the slug from URL and fetch the category details
2324
const route = useRoute();
@@ -38,6 +39,11 @@ if (error.value) {
3839
});
3940
}
4041
42+
const description = ref<string>('');
43+
onMounted(async () => {
44+
description.value = await marked(data.value?.shortDescription || '');
45+
});
46+
4147
// NOTE: the following is decrepecated as per Directors' decision.
4248
// shortDescription is the only available description for now.
4349

app/pages/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ useHead({
3636
</script>
3737

3838
<template>
39-
<div class="flex flex-col gap-5">
39+
<div class="flex flex-col gap-5 pb-10">
4040
<div v-if="store.profile?.role !== 'hacker'">
4141
<DashboardButton v-model="showAdminButtons" background="bg-red-ic">
4242
Admin Panels

bun.lock

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"hono": "^4.5.5",
2424
"hono-passkit-webservice": "^1.0.2",
2525
"lucia": "^3.2.0",
26+
"marked": "^15.0.6",
2627
"matter-js": "^0.20.0",
2728
"nodemailer": "^6.10.0",
2829
"nunjucks": "^3.2.4",
@@ -1340,6 +1341,8 @@
13401341

13411342
"mark.js": ["[email protected]", "", {}, "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ=="],
13421343

1344+
"marked": ["[email protected]", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-Y07CUOE+HQXbVDCGl3LXggqJDbXDP2pArc2C1N1RRMN0ONiShoSsIInMd5Gsxupe7fKLpgimTV+HOJ9r7bA+pg=="],
1345+
13431346
"marky": ["[email protected]", "", {}, "sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q=="],
13441347

13451348
"math-intrinsics": ["[email protected]", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"hono": "^4.5.5",
7171
"hono-passkit-webservice": "^1.0.2",
7272
"lucia": "^3.2.0",
73+
"marked": "^15.0.6",
7374
"matter-js": "^0.20.0",
7475
"nodemailer": "^6.10.0",
7576
"nunjucks": "^3.2.4",

packages/ui25/assets/css/tailwind.css

+4
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@
2828
@apply -right-4;
2929
}
3030
}
31+
32+
.markdown ul {
33+
@apply ml-4 list-disc;
34+
}

0 commit comments

Comments
 (0)