玉过滤器:markdown用于具有

编程入门 行业动态 更新时间:2024-10-18 18:22:28
本文介绍了玉过滤器: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用于具有

本文发布于:2023-11-22 13:43:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1617652.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:过滤器   markdown

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!