问题
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