markdown-it
Advanced tools
Comparing version 6.0.5 to 6.1.0
@@ -0,1 +1,8 @@ | ||
6.1.0 / 2016-06-19 | ||
------------------ | ||
- Updated `fence` renderer to not mutate token. Token stream should be | ||
immutable after renderer call. | ||
6.0.5 / 2016-06-01 | ||
@@ -2,0 +9,0 @@ ------------------ |
@@ -35,7 +35,6 @@ /** | ||
langName = '', | ||
highlighted; | ||
highlighted, i, tmpAttrs, tmpToken; | ||
if (info) { | ||
langName = info.split(/\s+/g)[0]; | ||
token.attrJoin('class', options.langPrefix + langName); | ||
} | ||
@@ -53,2 +52,26 @@ | ||
// If language exists, inject class gently, without mudofying original token. | ||
// May be, one day we will add .clone() for token and simplify this part, but | ||
// now we prefer to keep things local. | ||
if (info) { | ||
i = token.attrIndex('class'); | ||
tmpAttrs = token.attrs ? token.attrs.slice() : []; | ||
if (i < 0) { | ||
tmpAttrs.push([ 'class', options.langPrefix + langName ]); | ||
} else { | ||
tmpAttrs[i] += ' ' + options.langPrefix + langName; | ||
} | ||
// Fake token just to render attributes | ||
tmpToken = { | ||
attrs: tmpAttrs | ||
}; | ||
return '<pre><code' + slf.renderAttrs(tmpToken) + '>' | ||
+ highlighted | ||
+ '</code></pre>\n'; | ||
} | ||
return '<pre><code' + slf.renderAttrs(token) + '>' | ||
@@ -55,0 +78,0 @@ + highlighted |
{ | ||
"name": "markdown-it", | ||
"version": "6.0.5", | ||
"version": "6.1.0", | ||
"description": "Markdown-it - modern pluggable markdown parser.", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
"coveralls": "~2.11.9", | ||
"eslint": "~2.6.0", | ||
"eslint": "~2.13.0", | ||
"highlight.js": "^9.2.0", | ||
@@ -46,0 +46,0 @@ "istanbul": "*", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
524318
11383