markdown-it
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -0,1 +1,9 @@ | ||
2.1.1 / 2014-12-23 | ||
------------------ | ||
- Exposed helpers into parser instances (for plugins). | ||
- Removed utils from global export - been in instances seems enougth. | ||
- Refactored demo & added markdown-it-emoji to it. | ||
2.1.1 / 2014-12-22 | ||
@@ -2,0 +10,0 @@ ------------------ |
@@ -36,2 +36,8 @@ // Utilities | ||
// Remove element from array and put another array at those position. | ||
// Useful for some operations with tokens | ||
function arrayReplaceAt(src, pos, newElements) { | ||
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); | ||
} | ||
//////////////////////////////////////////////////////////////////////////////// | ||
@@ -128,4 +134,14 @@ | ||
function arrayReplaceAt(src, pos, newElements) { | ||
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); | ||
// Incoming link can be partially encoded. Convert possible combinations to | ||
// unified form. | ||
function normalizeLink(url) { | ||
var normalized = replaceEntities(url); | ||
// We don't care much about result of mailformed URIs, | ||
// but shoud not throw exception. | ||
try { | ||
normalized = decodeURI(normalized); | ||
} catch (__) {} | ||
return encodeURI(normalized); | ||
} | ||
@@ -143,1 +159,2 @@ | ||
exports.arrayReplaceAt = arrayReplaceAt; | ||
exports.normalizeLink = normalizeLink; |
'use strict'; | ||
// Hepler to [reference labels]. No better place for this code :) | ||
// It's only for refs/links and should not be exported anywhere. | ||
module.exports = function normalizeReference(str) { | ||
@@ -4,0 +7,0 @@ // use .toUpperCase() instead of .toLowerCase() |
@@ -9,3 +9,3 @@ // Parse link destination | ||
var normalizeLink = require('./normalize_link'); | ||
var normalizeLink = require('../common/utils').normalizeLink; | ||
var unescapeMd = require('../common/utils').unescapeMd; | ||
@@ -12,0 +12,0 @@ |
@@ -7,2 +7,3 @@ // Main perser class | ||
var utils = require('./common/utils'); | ||
var helpers = require('./helpers'); | ||
var assign = require('./common/utils').assign; | ||
@@ -56,4 +57,5 @@ var isString = require('./common/utils').isString; | ||
// Expose utils for easy acces from plugins | ||
// Expose utils & helpers for easy acces from plugins | ||
this.utils = utils; | ||
this.helpers = helpers; | ||
@@ -168,4 +170,1 @@ this.options = {}; | ||
module.exports = MarkdownIt; | ||
// Expose helpers, useful for custom renderer functions | ||
module.exports.utils = require('./common/utils'); |
@@ -6,3 +6,3 @@ // Process autolinks '<protocol:...>' | ||
var url_schemas = require('../common/url_schemas'); | ||
var normalizeLink = require('../helpers/normalize_link'); | ||
var normalizeLink = require('../common/utils').normalizeLink; | ||
@@ -9,0 +9,0 @@ |
{ | ||
"name": "markdown-it", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Markdown-it - modern pluggable markdown parser.", | ||
@@ -39,2 +39,3 @@ "keywords": [ | ||
"jade": "^1.6.0", | ||
"markdown-it-emoji": "~ 0.1.0", | ||
"markdown-it-testgen": "~ 0.1.0", | ||
@@ -41,0 +42,0 @@ "marked": "0.3.2", |
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
556851
14900
16