markdown-it
Advanced tools
Comparing version 7.0.0 to 7.0.1
@@ -0,1 +1,9 @@ | ||
7.0.1 / 2016-08-16 | ||
------------------ | ||
- Fence renderer: fix concat of class array, #276. | ||
- Code renderer: do not render double space before attrs, #275. | ||
- Replacer: disable replacements inside autolinks, #272. | ||
7.0.0 / 2016-06-22 | ||
@@ -2,0 +10,0 @@ ------------------ |
@@ -22,6 +22,5 @@ /** | ||
default_rules.code_inline = function (tokens, idx, options, env, slf) { | ||
var token = tokens[idx], | ||
attrs = slf.renderAttrs(token); | ||
var token = tokens[idx]; | ||
return '<code' + (attrs ? ' ' + attrs : '') + '>' + | ||
return '<code' + slf.renderAttrs(token) + '>' + | ||
escapeHtml(tokens[idx].content) + | ||
@@ -33,6 +32,5 @@ '</code>'; | ||
default_rules.code_block = function (tokens, idx, options, env, slf) { | ||
var token = tokens[idx], | ||
attrs = slf.renderAttrs(token); | ||
var token = tokens[idx]; | ||
return '<pre' + (attrs ? ' ' + attrs : '') + '><code>' + | ||
return '<pre' + slf.renderAttrs(token) + '><code>' + | ||
escapeHtml(tokens[idx].content) + | ||
@@ -73,3 +71,3 @@ '</code></pre>\n'; | ||
} else { | ||
tmpAttrs[i] += ' ' + options.langPrefix + langName; | ||
tmpAttrs[i][1] += ' ' + options.langPrefix + langName; | ||
} | ||
@@ -76,0 +74,0 @@ |
@@ -37,9 +37,18 @@ // Simple typographyc replacements | ||
function replace_scoped(inlineTokens) { | ||
var i, token; | ||
var i, token, inside_autolink = 0; | ||
for (i = inlineTokens.length - 1; i >= 0; i--) { | ||
token = inlineTokens[i]; | ||
if (token.type === 'text') { | ||
if (token.type === 'text' && !inside_autolink) { | ||
token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); | ||
} | ||
if (token.type === 'link_open' && token.info === 'auto') { | ||
inside_autolink--; | ||
} | ||
if (token.type === 'link_close' && token.info === 'auto') { | ||
inside_autolink++; | ||
} | ||
} | ||
@@ -49,7 +58,8 @@ } | ||
function replace_rare(inlineTokens) { | ||
var i, token; | ||
var i, token, inside_autolink = 0; | ||
for (i = inlineTokens.length - 1; i >= 0; i--) { | ||
token = inlineTokens[i]; | ||
if (token.type === 'text') { | ||
if (token.type === 'text' && !inside_autolink) { | ||
if (RARE_RE.test(token.content)) { | ||
@@ -69,2 +79,10 @@ token.content = token.content | ||
} | ||
if (token.type === 'link_open' && token.info === 'auto') { | ||
inside_autolink--; | ||
} | ||
if (token.type === 'link_close' && token.info === 'auto') { | ||
inside_autolink++; | ||
} | ||
} | ||
@@ -71,0 +89,0 @@ } |
{ | ||
"name": "markdown-it", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"description": "Markdown-it - modern pluggable markdown parser.", | ||
@@ -51,3 +51,3 @@ "keywords": [ | ||
"markdown-it-emoji": "^1.1.1", | ||
"markdown-it-footnote": "^2.0.0", | ||
"markdown-it-footnote": "^3.0.1", | ||
"markdown-it-for-inline": "~0.1.0", | ||
@@ -54,0 +54,0 @@ "markdown-it-ins": "^2.0.0", |
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
527506
11439