8000 comment support markdown · pycoder404/blog-vue@eef5ea6 · GitHub
[go: up one dir, main page]

Skip to content

Commit eef5ea6

Browse files
committed
comment support markdown
1 parent 442fb53 commit eef5ea6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"highlight.js": "^11.5.0",
1818
"highlightjs": "^9.16.2",
1919
"js-cookie": "^3.0.1",
20+
"marked": "^4.1.0",
2021
"mavon-editor": "^3.0.0-beta",
2122
"node-sass": "^7.0.1",
2223
"nprogress": "^0.2.0",

src/views/article/components/ArticleComment.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
<div class="card-header">
1111
<!-- todo add isAuthor label -->
1212
<span>
13-
<b>{{comment.author}}</b>
14-
<span>{{comment.created_time}}</span>
13+
<b>{{ comment.comment_order}} {{comment.author}}</b><span>{{comment.created_time}}</span>
1514

1615
</span>
1716
<el-button class="button" text>Operation button</el-button>
1817
</div>
1918
</template>
20-
{{comment.content}}
19+
<div v-if="comment.parent">
20+
<span> replied to <b>{{ comment.comment_order}} {{comment.author}}</b></span>
21+
22+
</div>
23+
<div v-hlcode v-html="comment.content"></div>
2124
</el-card>
2225
</div>
2326

0 commit comments

Comments
 (0)
0