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 6.0.5 to 6.1.0

7

CHANGELOG.md

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

27

lib/renderer.js

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

4

package.json
{
"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

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