2017-12-15 04:12:34 +00:00
|
|
|
<template>
|
2018-01-23 10:55:39 +00:00
|
|
|
<div v-html="marked($slots.default[0].text.trim() || '')" />
|
2017-12-15 04:12:34 +00:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import marked from 'marked'
|
|
|
|
marked.setOptions({
|
|
|
|
renderer: new marked.Renderer(),
|
|
|
|
gfm: true,
|
|
|
|
tables: true,
|
|
|
|
breaks: false,
|
|
|
|
pedantic: true,
|
|
|
|
sanitize: true,
|
|
|
|
smartLists: true,
|
|
|
|
smartypants: true,
|
|
|
|
})
|
|
|
|
export default {
|
|
|
|
name: 'md',
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
marked,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|