Socket
Socket
Sign inDemoInstall

markdown-it

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

8

CHANGELOG.md

@@ -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 @@ ------------------

12

lib/renderer.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc