Skip to content

Commit

Permalink
Markdown component
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakovri committed Sep 10, 2023
1 parent f1d231c commit b9bb49d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"axios": "^1.4.0",
"markdown-it": "^13.0.1",
"material-design-icons-iconfont": "^6.7.0",
"pinia": "^2.1.6",
"query-string": "^8.1.0",
Expand All @@ -29,6 +30,7 @@
"workbox-window": "^7.0.0"
},
"devDependencies": {
"@types/markdown-it": "^13.0.1",
"@types/node": "^20.5.0",
"@types/ua-parser-js": "^0.7.36",
"@typescript-eslint/eslint-plugin": "^6.4.0",
Expand Down
60 changes: 55 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/components/MarkdownRenderer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script setup lang="ts">
import Markdown from 'markdown-it';
const props = withDefaults(defineProps<{ text: string }>(), { text: '' });
const markdown = new Markdown();
</script>

<template>
<!-- eslint-disable vue/no-v-html -->
<div v-html="markdown.render(props.text)" />
<!-- eslint-enable -->
</template>

0 comments on commit b9bb49d

Please sign in to comment.