Skip to content

Commit

Permalink
include marked and transform markdown to html for use in template
Browse files Browse the repository at this point in the history
  • Loading branch information
Sambillingham committed Dec 6, 2018
1 parent 41cc194 commit 029b6bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"dsteem": "0.10.0",
"marked": "^0.5.2",
"vue": "^2.5.17",
"vue-router": "^3.0.1"
},
Expand Down
5 changes: 3 additions & 2 deletions src/components/SteemPost.vue
@@ -1,12 +1,13 @@
<template>
<div>
<h1>{{ title }}</h1>
<main>{{ content }}</main>
<main v-html="content"></main>
</div>
</template>

<script>
const dsteem = require('dsteem')
import marked from 'marked'
export default {
name: 'SteemPost',
Expand All @@ -21,7 +22,7 @@ export default {
client.call('condenser_api', 'get_content', [this.$route.params.username, this.$route.params.permlink])
.then(response => {
this.title = response.title
this.content = response.body
this.content = marked(response.body, { sanitize: true })
})
}
}
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Expand Up @@ -4167,6 +4167,10 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"

marked@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.5.2.tgz#3efdb27b1fd0ecec4f5aba362bddcd18120e5ba9"

md5.js@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
Expand Down

0 comments on commit 029b6bf

Please sign in to comment.