markdown-it
Advanced tools
Comparing version 8.0.1 to 8.1.0
@@ -0,1 +1,7 @@ | ||
8.1.0 / 2016-11-03 | ||
------------------ | ||
- Make link parse helpers (`md.helpers`) pluggable, #299. | ||
8.0.1 / 2016-10-18 | ||
@@ -2,0 +8,0 @@ ------------------ |
@@ -341,3 +341,3 @@ // Main parser class | ||
**/ | ||
this.helpers = helpers; | ||
this.helpers = utils.assign({}, helpers); | ||
@@ -344,0 +344,0 @@ |
'use strict'; | ||
var parseLinkDestination = require('../helpers/parse_link_destination'); | ||
var parseLinkTitle = require('../helpers/parse_link_title'); | ||
var normalizeReference = require('../common/utils').normalizeReference; | ||
@@ -109,3 +107,3 @@ var isSpace = require('../common/utils').isSpace; | ||
// ^^^^^^^^^^^ parse this | ||
res = parseLinkDestination(str, pos, max); | ||
res = state.md.helpers.parseLinkDestination(str, pos, max); | ||
if (!res.ok) { return false; } | ||
@@ -139,3 +137,3 @@ | ||
// ^^^^^^^ parse this | ||
res = parseLinkTitle(str, pos, max); | ||
res = state.md.helpers.parseLinkTitle(str, pos, max); | ||
if (pos < max && start !== pos && res.ok) { | ||
@@ -142,0 +140,0 @@ title = res.str; |
@@ -5,5 +5,2 @@ // Process ![image](<src> "title") | ||
var parseLinkLabel = require('../helpers/parse_link_label'); | ||
var parseLinkDestination = require('../helpers/parse_link_destination'); | ||
var parseLinkTitle = require('../helpers/parse_link_title'); | ||
var normalizeReference = require('../common/utils').normalizeReference; | ||
@@ -35,3 +32,3 @@ var isSpace = require('../common/utils').isSpace; | ||
labelStart = state.pos + 2; | ||
labelEnd = parseLinkLabel(state, state.pos + 1, false); | ||
labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); | ||
@@ -59,3 +56,3 @@ // parser failed to find ']', so it's not a valid link | ||
start = pos; | ||
res = parseLinkDestination(state.src, pos, state.posMax); | ||
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); | ||
if (res.ok) { | ||
@@ -80,3 +77,3 @@ href = state.md.normalizeLink(res.str); | ||
// ^^^^^^^ parsing link title | ||
res = parseLinkTitle(state.src, pos, state.posMax); | ||
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); | ||
if (pos < max && start !== pos && res.ok) { | ||
@@ -109,3 +106,3 @@ title = res.str; | ||
start = pos + 1; | ||
pos = parseLinkLabel(state, pos); | ||
pos = state.md.helpers.parseLinkLabel(state, pos); | ||
if (pos >= 0) { | ||
@@ -112,0 +109,0 @@ label = state.src.slice(start, pos++); |
@@ -5,5 +5,2 @@ // Process [link](<to> "stuff") | ||
var parseLinkLabel = require('../helpers/parse_link_label'); | ||
var parseLinkDestination = require('../helpers/parse_link_destination'); | ||
var parseLinkTitle = require('../helpers/parse_link_title'); | ||
var normalizeReference = require('../common/utils').normalizeReference; | ||
@@ -32,3 +29,3 @@ var isSpace = require('../common/utils').isSpace; | ||
labelStart = state.pos + 1; | ||
labelEnd = parseLinkLabel(state, state.pos, true); | ||
labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); | ||
@@ -56,3 +53,3 @@ // parser failed to find ']', so it's not a valid link | ||
start = pos; | ||
res = parseLinkDestination(state.src, pos, state.posMax); | ||
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); | ||
if (res.ok) { | ||
@@ -77,3 +74,3 @@ href = state.md.normalizeLink(res.str); | ||
// ^^^^^^^ parsing link title | ||
res = parseLinkTitle(state.src, pos, state.posMax); | ||
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); | ||
if (pos < max && start !== pos && res.ok) { | ||
@@ -106,3 +103,3 @@ title = res.str; | ||
start = pos + 1; | ||
pos = parseLinkLabel(state, pos); | ||
pos = state.md.helpers.parseLinkLabel(state, pos); | ||
if (pos >= 0) { | ||
@@ -109,0 +106,0 @@ label = state.src.slice(start, pos++); |
{ | ||
"name": "markdown-it", | ||
"version": "8.0.1", | ||
"version": "8.1.0", | ||
"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
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
537108
11689