Skip to content

Commit eb338b3

Browse files
author
An Phan
committed
Treat description as markdown
1 parent cdaf04c commit eb338b3

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

app/lib/parser.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from 'path'
33
import yaml from 'js-yaml'
44
import somebody from 'somebody'
55
import chalk from 'chalk'
6+
import marked from 'marked'
67

78
const opts = {
89
root: `${process.cwd()}/awesomeness`,
@@ -44,6 +45,10 @@ function parseDir(filename) {
4445
if (info.content.author) {
4546
info.content.author = somebody.parse(info.content.author)
4647
}
48+
49+
if (info.content.description) {
50+
info.content.description = marked(info.content.description)
51+
}
4752
}
4853

4954
return info

app/site/src/components/Item.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<template v-else>{{ item.author.name }}</template>
99
</span>
1010
</h1>
11-
<p class="thin" v-if="item.description">{{ item.description }}</p>
11+
<div class="thin" v-if="item.description" v-html="item.description"></div>
1212
<footer class="thin" v-if="item.tags">
1313
<ul>
1414
<li v-for="tag in item.tags">

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"file-loader": "^0.8.4",
2323
"js-yaml": "^3.6.1",
2424
"lodash": "^4.13.1",
25+
"marked": "^0.3.5",
2526
"node-sass": "^3.8.0",
2627
"sass-loader": "^3.2.1",
2728
"somebody": "^2.0.0",

0 commit comments

Comments
 (0)