Skip to content

Commit 3749d0e

Browse files
committed
cosm: markdown or rich-text
1 parent 9e21c71 commit 3749d0e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

components/comments/comment.wxml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@
3333
</view>
3434

3535
<view class="content-text">
36-
<markdown-viewer content="{{commentContent}}"/>
36+
<block wx:if="{{comment.isMarkdown}}">
37+
<markdown-viewer content="{{commentContent}}"/>
38+
</block>
39+
<block wx:else>
40+
<rich-text nodes="{{commentContent}}"/>
41+
</block>
3742
</view>
3843
</view>
3944

components/posts/post.wxml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
</view>
2828

2929
<view class="content-text">
30-
<markdown-viewer content="{{postContent}}"/>
30+
<block wx:if="{{post.isMarkdown}}">
31+
<markdown-viewer content="{{postContent}}"/>
32+
</block>
33+
<block wx:else>
34+
<rich-text nodes="{{postContent}}"/>
35+
</block>
3136
</view>
3237
</view>
3338

0 commit comments

Comments
 (0)