玉过滤器:markdown用于具有 [英] jade filter :markdown for an object with a

查看:94
本文介绍了玉过滤器: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:

这篇关于玉过滤器:markdown用于具有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆