Filtering markdown content for rendering in Jade?

℡╲_俬逩灬. 提交于 2020-06-01 05:13:08

问题


As a companion to How to allow filtering of plain-text into HTML tags in NodeJS and PUG? I have a web application in NodeJS and PUG/Jade. I want to separate the logic of the application, controlled by a developer, from the textual content, controlled by a marketing person and translators, while keeping all the source code integrated. (I asked about ways for this separation here and got no answers as of this writing).

I would like to Markdown formatting in the JSON object, such as **some bold text**, or links.

I understand from this thread that I could use a markdown filter, :markdown, to convert the source text with links for PUG:

You can use a markdown filter and use markdown (and allowed HTML) to write your paragraph.

:markdown
  this is the start of the para.
  [a link](http://example.com)
  and this is the rest of the paragraph.

I ran this and got an error unknown filter ":markdown".

How can I pre-process a plain-text with NodeJS and Jade to populate links and display them nicely to the browser user?

来源:https://stackoverflow.com/questions/61563658/filtering-markdown-content-for-rendering-in-jade

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!