@shiyanlou/marked
v2.2.22
Published
shiyanlou marked
Readme
marked-ext
安装
$ npm install @shiyanlou/marked --save使用
<template>
<div ref="marked" class="markdown-body" v-html="markedStr" />
</template>
<script>
import '@shiyanlou/marked/lib/styles.css'
import marked from '@shiyanlou/marked'
export default {
data() {
return {
str: '## 标题\n',
}
},
computed: {
markedStr() {
return marked(this.str)
},
},
mounted() {
marked.renderExtends(this.$refs.marked)
},
updated() {
marked.renderExtends(this.$refs.marked)
},
}
</script>一、插入公式(基于 Katex)
1. 行内公式
2. 独立成行的公式
二、插入视频(基于 video.js)
视频格式使用 mp4
