node.js - nodejs中jade过滤器中使用markdown,怎么实现mardkown文件中代码高亮?
阿神
阿神 2017-04-17 11:18:40
0
2
711

index.jade

doctype html
    html
      head
        title An Article
      body
        include:markdown article.md

article.md

<p class="container">content</p>

现在虽然把article.md文件解析了,但是代码不能实现高亮,请问下如何才能实现代码高亮呢。

阿神
阿神

闭关修行中......

reply all(2)
Peter_Zhu

MarkdownAfter the file parsing is completed, it will be HTMl. It should be possible to directly add PrittyPrint style highlighting code to HTML.

Or you can use Remark.js directly in HTML to display the markdown file on the client, so there is no need to include jade in markdown.

黄舟

After loading the html, load PrettyPrint to process the code, refer to the example here: http://witcheryne.iteye.com/blog/1172068

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template