本文介绍了玉过滤器:markdown用于具有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从数据库中获得了一个对象,该对象带有一些我想用玉呈现的markdown标记.但是如何?当我应用:markdown过滤器时,我不能再将该对象用作对象,但是它将被视为文本.
I have an object from the database with some markdown markup I would like to render with jade. But how? When I apply the :markdown filter I can't use the object as object anymore, but it get's treated as text.
我从这里开始
p :markdown entry.content哪个呈现为纯色:
entry.content因此,我尝试将=和-放在前面或将#{}包装在其周围.可能吗?
So I tried putting = and - in front or wrapping #{} arround it. Is it possible at all?
推荐答案过滤器是编译时的,因此,如果要在运行时变量上运行markdown过滤器,则必须自己渲染markdown并传递转到您的翡翠视图:
Filters are compile-time, so if you want to run a markdown filter on a run-time variable, you'll have to render the markdown yourself and pass it to your jade view:
- groups.google/forum /?fromgroups =#!topic/express-js/8H4HNcoeekk
更多推荐
玉过滤器:markdown用于具有
发布评论