Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.3.0 to 8.3.1

6

CHANGELOG.md

@@ -0,1 +1,7 @@

8.3.1 / 2017-03-06
------------------
- Fix blockquote termination by list item, #338.
8.3.0 / 2017-02-16

@@ -2,0 +8,0 @@ ------------------

38

lib/rules_block/blockquote.js

@@ -13,2 +13,3 @@ // Block quotes

initial,
isOutdented,
l,

@@ -29,5 +30,9 @@ lastLineEmpty,

token,
oldLineMax = state.lineMax,
pos = state.bMarks[startLine] + state.tShift[startLine],
max = state.eMarks[startLine];
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
// check the block quote marker

@@ -40,5 +45,2 @@ if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }

oldIndent = state.blkIndent;
state.blkIndent = 0;
// skip spaces after ">" and re-calculate offset

@@ -124,3 +126,3 @@ initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);

// ```
// 3. another tag
// 3. another tag:
// ```

@@ -131,3 +133,11 @@ // > test

for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
if (state.sCount[nextLine] < oldIndent) { break; }
// check if it's outdented, i.e. it's inside list item and indented
// less than said list item:
//
// ```
// 1. anything
// > current blockquote
// 2. checking this line
// ```
isOutdented = state.sCount[nextLine] < state.blkIndent;

@@ -142,3 +152,3 @@ pos = state.bMarks[nextLine] + state.tShift[nextLine];

if (state.src.charCodeAt(pos++) === 0x3E/* > */) {
if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
// This line is inside the blockquote.

@@ -223,3 +233,9 @@

if (terminate) {
if (oldIndent !== 0) {
// Quirk to enforce "hard termination mode" for paragraphs;
// normally if you call `tokenize(state, startLine, nextLine)`,
// paragraphs will look below nextLine for paragraph continuation,
// but if blockquote is terminated by another tag, they shouldn't
state.lineMax = nextLine;
if (state.blkIndent !== 0) {
// state.blkIndent was non-zero, we now set it to zero,

@@ -232,3 +248,3 @@ // so we need to re-calculate all offsets to appear as

oldSCount.push(state.sCount[nextLine]);
state.sCount[nextLine] -= oldIndent;
state.sCount[nextLine] -= state.blkIndent;
}

@@ -239,2 +255,4 @@

if (isOutdented) break;
oldBMarks.push(state.bMarks[nextLine]);

@@ -250,2 +268,5 @@ oldBSCount.push(state.bsCount[nextLine]);

oldIndent = state.blkIndent;
state.blkIndent = 0;
token = state.push('blockquote_open', 'blockquote', 1);

@@ -260,2 +281,3 @@ token.markup = '>';

state.lineMax = oldLineMax;
state.parentType = oldParentType;

@@ -262,0 +284,0 @@ lines[1] = state.line;

@@ -12,2 +12,5 @@ // fences (``` lang, ~~~ lang)

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
if (pos + 3 > max) { return false; }

@@ -14,0 +17,0 @@

@@ -13,2 +13,5 @@ // heading (#, ##, ...)

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
ch = state.src.charCodeAt(pos);

@@ -15,0 +18,0 @@

@@ -13,2 +13,5 @@ // Horizontal rule

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
marker = state.src.charCodeAt(pos++);

@@ -15,0 +18,0 @@

@@ -28,2 +28,5 @@ // HTML block

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
if (!state.md.options.html) { return false; }

@@ -30,0 +33,0 @@

@@ -11,2 +11,5 @@ // lheading (---, ===)

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
oldParentType = state.parentType;

@@ -13,0 +16,0 @@ state.parentType = 'paragraph'; // use paragraph to match terminatorRules

@@ -132,2 +132,5 @@ // Lists

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
// limit conditions when list can interrupt

@@ -134,0 +137,0 @@ // a paragraph (validation mode only)

@@ -30,2 +30,5 @@ 'use strict';

// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }

@@ -32,0 +35,0 @@

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

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

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