Update to support wrap syntax for code block

This commit is contained in:
Wu Cheng-Han 2016-10-14 17:35:35 +08:00
parent f93e8f5fdc
commit 211d25253e
4 changed files with 20 additions and 3 deletions

View file

@ -61,7 +61,8 @@ md.renderer.rules.fence = function (tokens, idx, options, env, self) {
if (info) {
langName = info.split(/\s+/g)[0];
token.attrJoin('class', options.langPrefix + langName.replace(/\=$|\=\d+$|\=\+$/, ''));
if (/\!$/.test(info)) token.attrJoin('class', 'wrap');
token.attrJoin('class', options.langPrefix + langName.replace(/\=$|\=\d+$|\=\+$|\!$|\=\!/, ''));
token.attrJoin('class', 'hljs');
}