如果你愿意,一层一层一层地剥开我的心,你会发现我缺心眼。

prism 实现代码高亮测试


	//使用prism实现代码高亮


	const Prism = require('prismjs');
const loadLanguages = require('prismjs/components/');
loadLanguages(['haml']);

// The code snippet you want to highlight, as a string
const code = `= ['hi', 'there', 'reader!'].join " "`;

// Returns a highlighted HTML string
const html = Prism.highlight(code, Prism.languages.haml, 'haml');

标签code highlight

最新评论