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 8.2.2 to 8.3.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

8.3.0 / 2017-02-16
------------------
- Fix table indentation issues, #325, #224.
- Remove tabs at the beginning of the line in paragraphs.
- Fix blockquote termination inside indented lists, #329.
- Better error message for bad input type, #324.
8.2.2 / 2016-12-15

@@ -2,0 +11,0 @@ ------------------

4

lib/index.js

@@ -517,2 +517,6 @@ // Main parser class

MarkdownIt.prototype.parse = function (src, env) {
if (typeof src !== 'string') {
throw new Error('Input data should be a String');
}
var state = new this.core.State(src, this, env);

@@ -519,0 +523,0 @@

@@ -215,4 +215,18 @@ // Block quotes

}
if (terminate) { break; }
if (terminate) {
if (oldIndent !== 0) {
// state.blkIndent was non-zero, we now set it to zero,
// so we need to re-calculate all offsets to appear as
// if indent wasn't changed
oldBMarks.push(state.bMarks[nextLine]);
oldBSCount.push(state.bsCount[nextLine]);
oldTShift.push(state.tShift[nextLine]);
oldSCount.push(state.sCount[nextLine]);
state.sCount[nextLine] -= oldIndent;
}
break;
}
oldBMarks.push(state.bMarks[nextLine]);

@@ -219,0 +233,0 @@ oldBSCount.push(state.bsCount[nextLine]);

14

lib/rules_block/table.js

@@ -71,3 +71,3 @@ // GFM table, non-standard

// should have at least three lines
// should have at least two lines
if (startLine + 2 > endLine) { return false; }

@@ -79,2 +79,5 @@

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
// first character of the second line should be '|', '-', ':',

@@ -126,2 +129,3 @@ // and no other characters are allowed but spaces;

if (lineText.indexOf('|') === -1) { return false; }
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));

@@ -169,9 +173,7 @@

lineText = getLine(state, nextLine);
lineText = getLine(state, nextLine).trim();
if (lineText.indexOf('|') === -1) { break; }
if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
// keep spaces at beginning of line to indicate an empty first cell, but
// strip trailing whitespace
columns = escapedSplit(lineText.replace(/^\||\|\s*$/g, ''));
token = state.push('tr_open', 'tr', 1);

@@ -178,0 +180,0 @@ for (i = 0; i < columnCount; i++) {

@@ -5,2 +5,5 @@ // Proceess '\n'

var isSpace = require('../common/utils').isSpace;
module.exports = function newline(state, silent) {

@@ -36,3 +39,3 @@ var pmax, max, pos = state.pos;

// skip heading spaces for next line
while (pos < max && state.src.charCodeAt(pos) === 0x20) { pos++; }
while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }

@@ -39,0 +42,0 @@ state.pos = pos;

{
"name": "markdown-it",
"version": "8.2.2",
"version": "8.3.0",
"description": "Markdown-it - modern pluggable markdown parser.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -201,4 +201,4 @@ # markdown-it

- [Tables](https://help.github.com/articles/github-flavored-markdown/#tables) (GFM)
- [Strikethrough](https://help.github.com/articles/github-flavored-markdown/#strikethrough) (GFM)
- [Tables](https://help.github.com/articles/organizing-information-with-tables/) (GFM)
- [Strikethrough](https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text) (GFM)

@@ -205,0 +205,0 @@ Via plugins:

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