|
@ -60,7 +60,7 @@ default_rules.fence = function (tokens, idx, options, env, slf) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// If language exists, inject class gently, without modifying original token.
|
|
|
// If language exists, inject class gently, without modifying original token.
|
|
|
// May be, one day we will add .clone() for token and simplify this part, but
|
|
|
// May be, one day we will add .deepClone() for token and simplify this part, but
|
|
|
// now we prefer to keep things local.
|
|
|
// now we prefer to keep things local.
|
|
|
if (info) { |
|
|
if (info) { |
|
|
i = token.attrIndex('class'); |
|
|
i = token.attrIndex('class'); |
|
@ -69,6 +69,7 @@ default_rules.fence = function (tokens, idx, options, env, slf) { |
|
|
if (i < 0) { |
|
|
if (i < 0) { |
|
|
tmpAttrs.push([ 'class', options.langPrefix + langName ]); |
|
|
tmpAttrs.push([ 'class', options.langPrefix + langName ]); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
tmpAttrs[i] = tmpAttrs[i].slice(); |
|
|
tmpAttrs[i][1] += ' ' + options.langPrefix + langName; |
|
|
tmpAttrs[i][1] += ' ' + options.langPrefix + langName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|