Fix code block which in deeper level will not be parsed issue
This commit is contained in:
@@ -64,6 +64,7 @@ md.renderer.rules.fence = function (tokens, idx, options, env, self) {
|
||||
if (/\!$/.test(info)) token.attrJoin('class', 'wrap');
|
||||
token.attrJoin('class', options.langPrefix + langName.replace(/\=$|\=\d+$|\=\+$|\!$|\=\!/, ''));
|
||||
token.attrJoin('class', 'hljs');
|
||||
token.attrJoin('class', 'raw');
|
||||
}
|
||||
|
||||
if (options.highlight) {
|
||||
@@ -79,7 +80,7 @@ md.renderer.rules.fence = function (tokens, idx, options, env, self) {
|
||||
if (tokens[idx].map && tokens[idx].level === 0) {
|
||||
var startline = tokens[idx].map[0] + 1;
|
||||
var endline = tokens[idx].map[1];
|
||||
return '<pre class="part raw" data-startline="' + startline + '" data-endline="' + endline + '"><code' + self.renderAttrs(token) + '>'
|
||||
return '<pre class="part" data-startline="' + startline + '" data-endline="' + endline + '"><code' + self.renderAttrs(token) + '>'
|
||||
+ highlighted
|
||||
+ '</code></pre>\n';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user