Browse Source
Deep copy `token.attrs` to avoid mutating token stream
pull/745/head
Taneli Hukkinen
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
lib/renderer.js
|
|
@ -64,7 +64,7 @@ default_rules.fence = function (tokens, idx, options, env, slf) { |
|
|
|
// now we prefer to keep things local.
|
|
|
|
if (info) { |
|
|
|
i = token.attrIndex('class'); |
|
|
|
tmpAttrs = token.attrs ? token.attrs.slice() : []; |
|
|
|
tmpAttrs = token.attrs ? JSON.parse(JSON.stringify(token.attrs)) : []; |
|
|
|
|
|
|
|
if (i < 0) { |
|
|
|
tmpAttrs.push([ 'class', options.langPrefix + langName ]); |
|
|
|