Skip to content

Commit

Permalink
Merge pull request #146 from YoungYo/master
Browse files Browse the repository at this point in the history
Markdown 增加对 mermaid 渲染的支持;前台 Markdown 支持图片居中显示
  • Loading branch information
linhaojun857 authored Sep 3, 2023
2 parents f1ba975 + af33601 commit 60a8fbd
Show file tree
Hide file tree
Showing 8 changed files with 2,079 additions and 21 deletions.
1,048 changes: 1,038 additions & 10 deletions aurora-vue/aurora-admin/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions aurora-vue/aurora-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"deploy": "node deploy.js"
},
"dependencies": {
"@agoose77/markdown-it-mermaid": "^1.1.0",
"@iktakahiro/markdown-it-katex": "^4.0.1",
"axios": "^0.27.2",
"core-js": "^3.8.3",
Expand Down
1 change: 1 addition & 0 deletions aurora-vue/aurora-admin/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title>后台管理系统</title>
<script src="<%= BASE_URL %>lib/js/prism.js" data-manual></script>
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
<link rel="stylesheet" href="<%= BASE_URL %>lib/css/prism.css" />
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion aurora-vue/aurora-admin/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import VueCalendarHeatmap from 'vue-calendar-heatmap'
import tagCloud from './components/tag-cloud'
import dayjs from 'dayjs'
import Md_Katex from '@iktakahiro/markdown-it-katex'
import mermaidPlugin from "@agoose77/markdown-it-mermaid";

Vue.config.productionTip = false
Vue.prototype.config = config
Expand All @@ -35,7 +36,7 @@ Vue.use(VueCalendarHeatmap)
Vue.use(VueAxios, axios)
Vue.component('v-chart', ECharts)
Vue.prototype.$moment = dayjs
mavonEditor.markdownIt.set({}).use(Md_Katex);
mavonEditor.markdownIt.set({}).use(Md_Katex).use(mermaidPlugin);

Vue.filter('date', function (value, formatStr = 'YYYY-MM-DD') {
return dayjs(value).format(formatStr)
Expand Down
Loading

0 comments on commit 60a8fbd

Please sign in to comment.