我使用 pug 作为模板引擎。
我可以在我的页面上加载内容。按照我的一些代码片段:
服务器.js
routing.get('/introduction', (req, resp) => {
loadContent( function(err, content){
if(content){
resp.render('intro_page', content);
}
});
});
function loadContent( cb ){
const cont = {
explanation: ['Word three of paragraph one shall be bold. ', 'Words one and five of paragraph 2 shall be bold.', 'Words one up to four of paragraph 3 shall be bold.', 'and so on'],
};
return cb(null, cont);
}
intro_page.pug
div
each paragraph in explanation
div= paragraph
期望的结果
第一段三字加粗。
第二款一、五字加粗。
第 3 款第 1至第 4 个单词应加粗。
等等
哈巴狗和我的方法有没有办法将任意选择的单词设置为粗体?我的在线搜索仍然没有结果。我怎样才能做到这一点?