markdown-it-include
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,5 +0,8 @@ | ||
/*! markdown-it-include 0.0.1 https://github.com//camelaissani//markdown-it-include @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitInclude = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
/*! markdown-it-include 1.0.1 https://github.com//camelaissani//markdown-it-include @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitInclude = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
},{}],2:[function(require,module,exports){ | ||
(function (process){ | ||
// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, | ||
// backported and transplited with Babel, with backwards-compat fixes | ||
// Copyright Joyent, Inc. and other Node contributors. | ||
@@ -56,10 +59,2 @@ // | ||
// Split a filename into [root, dir, basename, ext], unix version | ||
// 'root' is just a slash, or nothing. | ||
var splitPathRe = | ||
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; | ||
var splitPath = function(filename) { | ||
return splitPathRe.exec(filename).slice(1); | ||
}; | ||
// path.resolve([from ...], to) | ||
@@ -180,24 +175,63 @@ // posix version | ||
exports.dirname = function(path) { | ||
var result = splitPath(path), | ||
root = result[0], | ||
dir = result[1]; | ||
exports.dirname = function (path) { | ||
if (typeof path !== 'string') path = path + ''; | ||
if (path.length === 0) return '.'; | ||
var code = path.charCodeAt(0); | ||
var hasRoot = code === 47 /*/*/; | ||
var end = -1; | ||
var matchedSlash = true; | ||
for (var i = path.length - 1; i >= 1; --i) { | ||
code = path.charCodeAt(i); | ||
if (code === 47 /*/*/) { | ||
if (!matchedSlash) { | ||
end = i; | ||
break; | ||
} | ||
} else { | ||
// We saw the first non-path separator | ||
matchedSlash = false; | ||
} | ||
} | ||
if (!root && !dir) { | ||
// No dirname whatsoever | ||
return '.'; | ||
if (end === -1) return hasRoot ? '/' : '.'; | ||
if (hasRoot && end === 1) { | ||
// return '//'; | ||
// Backwards-compat fix: | ||
return '/'; | ||
} | ||
return path.slice(0, end); | ||
}; | ||
if (dir) { | ||
// It has a dirname, strip trailing slash | ||
dir = dir.substr(0, dir.length - 1); | ||
function basename(path) { | ||
if (typeof path !== 'string') path = path + ''; | ||
var start = 0; | ||
var end = -1; | ||
var matchedSlash = true; | ||
var i; | ||
for (i = path.length - 1; i >= 0; --i) { | ||
if (path.charCodeAt(i) === 47 /*/*/) { | ||
// If we reached a path separator that was not part of a set of path | ||
// separators at the end of the string, stop now | ||
if (!matchedSlash) { | ||
start = i + 1; | ||
break; | ||
} | ||
} else if (end === -1) { | ||
// We saw the first non-path separator, mark this as the end of our | ||
// path component | ||
matchedSlash = false; | ||
end = i + 1; | ||
} | ||
} | ||
return root + dir; | ||
}; | ||
if (end === -1) return ''; | ||
return path.slice(start, end); | ||
} | ||
exports.basename = function(path, ext) { | ||
var f = splitPath(path)[2]; | ||
// TODO: make this comparison case-insensitive on windows? | ||
// Uses a mixed approach for backwards-compatibility, as ext behavior changed | ||
// in new Node.js versions, so only basename() above is backported here | ||
exports.basename = function (path, ext) { | ||
var f = basename(path); | ||
if (ext && f.substr(-1 * ext.length) === ext) { | ||
@@ -209,5 +243,49 @@ f = f.substr(0, f.length - ext.length); | ||
exports.extname = function (path) { | ||
if (typeof path !== 'string') path = path + ''; | ||
var startDot = -1; | ||
var startPart = 0; | ||
var end = -1; | ||
var matchedSlash = true; | ||
// Track the state of characters (if any) we see before our first dot and | ||
// after any path separator we find | ||
var preDotState = 0; | ||
for (var i = path.length - 1; i >= 0; --i) { | ||
var code = path.charCodeAt(i); | ||
if (code === 47 /*/*/) { | ||
// If we reached a path separator that was not part of a set of path | ||
// separators at the end of the string, stop now | ||
if (!matchedSlash) { | ||
startPart = i + 1; | ||
break; | ||
} | ||
continue; | ||
} | ||
if (end === -1) { | ||
// We saw the first non-path separator, mark this as the end of our | ||
// extension | ||
matchedSlash = false; | ||
end = i + 1; | ||
} | ||
if (code === 46 /*.*/) { | ||
// If this is our first dot, mark it as the start of our extension | ||
if (startDot === -1) | ||
startDot = i; | ||
else if (preDotState !== 1) | ||
preDotState = 1; | ||
} else if (startDot !== -1) { | ||
// We saw a non-dot and non-path separator before our dot, so we should | ||
// have a good chance at having a non-empty extension | ||
preDotState = -1; | ||
} | ||
} | ||
exports.extname = function(path) { | ||
return splitPath(path)[3]; | ||
if (startDot === -1 || end === -1 || | ||
// We saw a non-dot character immediately before the dot | ||
preDotState === 0 || | ||
// The (right-most) trimmed path component is exactly '..' | ||
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { | ||
return ''; | ||
} | ||
return path.slice(startDot, end); | ||
}; | ||
@@ -236,4 +314,90 @@ | ||
// shim for using process in browser | ||
var process = module.exports = {}; | ||
var process = module.exports = {}; | ||
// cached from whatever global is present so that test runners that stub it | ||
// don't break things. But we need to wrap it in a try catch in case it is | ||
// wrapped in strict mode code which doesn't define any globals. It's inside a | ||
// function because try/catches deoptimize in certain engines. | ||
var cachedSetTimeout; | ||
var cachedClearTimeout; | ||
function defaultSetTimout() { | ||
throw new Error('setTimeout has not been defined'); | ||
} | ||
function defaultClearTimeout () { | ||
throw new Error('clearTimeout has not been defined'); | ||
} | ||
(function () { | ||
try { | ||
if (typeof setTimeout === 'function') { | ||
cachedSetTimeout = setTimeout; | ||
} else { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
} catch (e) { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
try { | ||
if (typeof clearTimeout === 'function') { | ||
cachedClearTimeout = clearTimeout; | ||
} else { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} catch (e) { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} ()) | ||
function runTimeout(fun) { | ||
if (cachedSetTimeout === setTimeout) { | ||
//normal enviroments in sane situations | ||
return setTimeout(fun, 0); | ||
} | ||
// if setTimeout wasn't available but was latter defined | ||
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { | ||
cachedSetTimeout = setTimeout; | ||
return setTimeout(fun, 0); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedSetTimeout(fun, 0); | ||
} catch(e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedSetTimeout.call(null, fun, 0); | ||
} catch(e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error | ||
return cachedSetTimeout.call(this, fun, 0); | ||
} | ||
} | ||
} | ||
function runClearTimeout(marker) { | ||
if (cachedClearTimeout === clearTimeout) { | ||
//normal enviroments in sane situations | ||
return clearTimeout(marker); | ||
} | ||
// if clearTimeout wasn't available but was latter defined | ||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { | ||
cachedClearTimeout = clearTimeout; | ||
return clearTimeout(marker); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedClearTimeout(marker); | ||
} catch (e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedClearTimeout.call(null, marker); | ||
} catch (e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. | ||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout | ||
return cachedClearTimeout.call(this, marker); | ||
} | ||
} | ||
} | ||
var queue = []; | ||
@@ -245,2 +409,5 @@ var draining = false; | ||
function cleanUpNextTick() { | ||
if (!draining || !currentQueue) { | ||
return; | ||
} | ||
draining = false; | ||
@@ -261,3 +428,3 @@ if (currentQueue.length) { | ||
} | ||
var timeout = setTimeout(cleanUpNextTick); | ||
var timeout = runTimeout(cleanUpNextTick); | ||
draining = true; | ||
@@ -279,3 +446,3 @@ | ||
draining = false; | ||
clearTimeout(timeout); | ||
runClearTimeout(timeout); | ||
} | ||
@@ -292,3 +459,3 @@ | ||
if (queue.length === 1 && !draining) { | ||
setTimeout(drainQueue, 0); | ||
runTimeout(drainQueue); | ||
} | ||
@@ -321,3 +488,7 @@ }; | ||
process.emit = noop; | ||
process.prependListener = noop; | ||
process.prependOnceListener = noop; | ||
process.listeners = function (name) { return [] } | ||
process.binding = function (name) { | ||
@@ -342,5 +513,4 @@ throw new Error('process.binding is not supported'); | ||
module.exports = function include_plugin(md, basedir) { | ||
var filesProcessed; | ||
function _replaceIncludeByContent(src, rootdir, parentFilePath) { | ||
function _replaceIncludeByContent(src, rootdir, parentFilePath, filesProcessed) { | ||
filesProcessed = filesProcessed ? filesProcessed.slice() : []; // making a copy | ||
var cap, filePath, mdSrc, indexOfCircularRef; | ||
@@ -362,3 +532,4 @@ | ||
// replace include by file content | ||
mdSrc = _replaceIncludeByContent(fs.readFileSync(filePath, 'utf8'), path.dirname(filePath), filePath); | ||
mdSrc = fs.readFileSync(filePath, 'utf8'); | ||
mdSrc = _replaceIncludeByContent(mdSrc, path.dirname(filePath), filePath, filesProcessed); | ||
src = src.slice(0, cap.index) + mdSrc + src.slice(cap.index + cap[0].length, src.length); | ||
@@ -371,3 +542,2 @@ } | ||
var rootdir = basedir || '.'; | ||
filesProcessed = []; | ||
state.src = _replaceIncludeByContent(state.src, rootdir); | ||
@@ -380,2 +550,2 @@ } | ||
},{"fs":1,"path":2}]},{},[4])(4) | ||
}); | ||
}); |
@@ -1,2 +0,1 @@ | ||
/*! markdown-it-include 0.0.1 https://github.com//camelaissani//markdown-it-include @license MIT */ | ||
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.markdownitInclude=n()}}(function(){return function n(r,e,t){function i(u,s){if(!e[u]){if(!r[u]){var f="function"==typeof require&&require;if(!s&&f)return f(u,!0);if(o)return o(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[u]={exports:{}};r[u][0].call(l.exports,function(n){var e=r[u][1][n];return i(e?e:n)},l,l.exports,n,r,e,t)}return e[u].exports}for(var o="function"==typeof require&&require,u=0;u<t.length;u++)i(t[u]);return i}({1:[function(n,r,e){},{}],2:[function(n,r,e){(function(n){function r(n,r){for(var e=0,t=n.length-1;t>=0;t--){var i=n[t];"."===i?n.splice(t,1):".."===i?(n.splice(t,1),e++):e&&(n.splice(t,1),e--)}if(r)for(;e--;e)n.unshift("..");return n}function t(n,r){if(n.filter)return n.filter(r);for(var e=[],t=0;t<n.length;t++)r(n[t],t,n)&&e.push(n[t]);return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(n){return i.exec(n).slice(1)};e.resolve=function(){for(var e="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var u=o>=0?arguments[o]:n.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(e=u+"/"+e,i="/"===u.charAt(0))}return e=r(t(e.split("/"),function(n){return!!n}),!i).join("/"),(i?"/":"")+e||"."},e.normalize=function(n){var i=e.isAbsolute(n),o="/"===u(n,-1);return n=r(t(n.split("/"),function(n){return!!n}),!i).join("/"),n||i||(n="."),n&&o&&(n+="/"),(i?"/":"")+n},e.isAbsolute=function(n){return"/"===n.charAt(0)},e.join=function(){var n=Array.prototype.slice.call(arguments,0);return e.normalize(t(n,function(n,r){if("string"!=typeof n)throw new TypeError("Arguments to path.join must be strings");return n}).join("/"))},e.relative=function(n,r){function t(n){for(var r=0;r<n.length&&""===n[r];r++);for(var e=n.length-1;e>=0&&""===n[e];e--);return r>e?[]:n.slice(r,e-r+1)}n=e.resolve(n).substr(1),r=e.resolve(r).substr(1);for(var i=t(n.split("/")),o=t(r.split("/")),u=Math.min(i.length,o.length),s=u,f=0;u>f;f++)if(i[f]!==o[f]){s=f;break}for(var c=[],f=s;f<i.length;f++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},e.sep="/",e.delimiter=":",e.dirname=function(n){var r=o(n),e=r[0],t=r[1];return e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."},e.basename=function(n,r){var e=o(n)[2];return r&&e.substr(-1*r.length)===r&&(e=e.substr(0,e.length-r.length)),e},e.extname=function(n){return o(n)[3]};var u="b"==="ab".substr(-1)?function(n,r,e){return n.substr(r,e)}:function(n,r,e){return 0>r&&(r=n.length+r),n.substr(r,e)}}).call(this,n("_process"))},{_process:3}],3:[function(n,r,e){function t(){l=!1,s.length?c=s.concat(c):a=-1,c.length&&i()}function i(){if(!l){var n=setTimeout(t);l=!0;for(var r=c.length;r;){for(s=c,c=[];++a<r;)s&&s[a].run();a=-1,r=c.length}s=null,l=!1,clearTimeout(n)}}function o(n,r){this.fun=n,this.array=r}function u(){}var s,f=r.exports={},c=[],l=!1,a=-1;f.nextTick=function(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];c.push(new o(n,r)),1!==c.length||l||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.binding=function(n){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(n){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],4:[function(n,r,e){"use strict";var t=n("path"),i=n("fs"),o=/\!{3}\s*include\s*\(\s*(.+?)\s*\)\s*\!{3}/i;r.exports=function(n,r){function e(n,r,u){var f,c,l,a;for(u&&s.push(u);f=o.exec(n);){if(c=t.resolve(r,f[1]),a=s.indexOf(c),-1!==a)throw new Error("Circular reference between "+c+" and "+s[a]);l=e(i.readFileSync(c,"utf8"),t.dirname(c),c),n=n.slice(0,f.index)+l+n.slice(f.index+f[0].length,n.length)}return n}function u(n){var t=r||".";s=[],n.src=e(n.src,t)}var s;n.core.ruler.before("normalize","include",u)}},{fs:1,path:2}]},{},[4])(4)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).markdownitInclude=e()}}(function(){return function o(u,f,s){function c(r,e){if(!f[r]){if(!u[r]){var n="function"==typeof require&&require;if(!e&&n)return n(r,!0);if(l)return l(r,!0);var t=new Error("Cannot find module '"+r+"'");throw t.code="MODULE_NOT_FOUND",t}var i=f[r]={exports:{}};u[r][0].call(i.exports,function(e){return c(u[r][1][e]||e)},i,i.exports,o,u,f,s)}return f[r].exports}for(var l="function"==typeof require&&require,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,r,n){},{}],2:[function(e,r,c){(function(i){function o(e,r){for(var n=0,t=e.length-1;0<=t;t--){var i=e[t];"."===i?e.splice(t,1):".."===i?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(r)for(;n--;n)e.unshift("..");return e}function u(e,r){if(e.filter)return e.filter(r);for(var n=[],t=0;t<e.length;t++)r(e[t],t,e)&&n.push(e[t]);return n}c.resolve=function(){for(var e="",r=!1,n=arguments.length-1;-1<=n&&!r;n--){var t=0<=n?arguments[n]:i.cwd();if("string"!=typeof t)throw new TypeError("Arguments to path.resolve must be strings");t&&(e=t+"/"+e,r="/"===t.charAt(0))}return(r?"/":"")+(e=o(u(e.split("/"),function(e){return!!e}),!r).join("/"))||"."},c.normalize=function(e){var r=c.isAbsolute(e),n="/"===t(e,-1);return(e=o(u(e.split("/"),function(e){return!!e}),!r).join("/"))||r||(e="."),e&&n&&(e+="/"),(r?"/":"")+e},c.isAbsolute=function(e){return"/"===e.charAt(0)},c.join=function(){var e=Array.prototype.slice.call(arguments,0);return c.normalize(u(e,function(e,r){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},c.relative=function(e,r){function n(e){for(var r=0;r<e.length&&""===e[r];r++);for(var n=e.length-1;0<=n&&""===e[n];n--);return n<r?[]:e.slice(r,n-r+1)}e=c.resolve(e).substr(1),r=c.resolve(r).substr(1);for(var t=n(e.split("/")),i=n(r.split("/")),o=Math.min(t.length,i.length),u=o,f=0;f<o;f++)if(t[f]!==i[f]){u=f;break}var s=[];for(f=u;f<t.length;f++)s.push("..");return(s=s.concat(i.slice(u))).join("/")},c.sep="/",c.delimiter=":",c.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,t=-1,i=!0,o=e.length-1;1<=o;--o)if(47===(r=e.charCodeAt(o))){if(!i){t=o;break}}else i=!1;return-1===t?n?"/":".":n&&1===t?"/":e.slice(0,t)},c.basename=function(e,r){var n=function(e){"string"!=typeof e&&(e+="");var r,n=0,t=-1,i=!0;for(r=e.length-1;0<=r;--r)if(47===e.charCodeAt(r)){if(!i){n=r+1;break}}else-1===t&&(i=!1,t=r+1);return-1===t?"":e.slice(n,t)}(e);return r&&n.substr(-1*r.length)===r&&(n=n.substr(0,n.length-r.length)),n},c.extname=function(e){"string"!=typeof e&&(e+="");for(var r=-1,n=0,t=-1,i=!0,o=0,u=e.length-1;0<=u;--u){var f=e.charCodeAt(u);if(47===f){if(i)continue;n=u+1;break}-1===t&&(i=!1,t=u+1),46===f?-1===r?r=u:1!==o&&(o=1):-1!==r&&(o=-1)}return-1===r||-1===t||0===o||1===o&&r===t-1&&r===n+1?"":e.slice(r,t)};var t="b"==="ab".substr(-1)?function(e,r,n){return e.substr(r,n)}:function(e,r,n){return r<0&&(r=e.length+r),e.substr(r,n)}}).call(this,e("_process"))},{_process:3}],3:[function(e,r,n){var t,i,o=r.exports={};function u(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}function s(r){if(t===setTimeout)return setTimeout(r,0);if((t===u||!t)&&setTimeout)return t=setTimeout,setTimeout(r,0);try{return t(r,0)}catch(e){try{return t.call(null,r,0)}catch(e){return t.call(this,r,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:u}catch(e){t=u}try{i="function"==typeof clearTimeout?clearTimeout:f}catch(e){i=f}}();var c,l=[],a=!1,h=-1;function p(){a&&c&&(a=!1,c.length?l=c.concat(l):h=-1,l.length&&d())}function d(){if(!a){var e=s(p);a=!0;for(var r=l.length;r;){for(c=l,l=[];++h<r;)c&&c[h].run();h=-1,r=l.length}c=null,a=!1,function(r){if(i===clearTimeout)return clearTimeout(r);if((i===f||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(r);try{i(r)}catch(e){try{return i.call(null,r)}catch(e){return i.call(this,r)}}}(e)}}function v(e,r){this.fun=e,this.array=r}function g(){}o.nextTick=function(e){var r=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];l.push(new v(e,r)),1!==l.length||a||s(d)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],4:[function(e,r,n){"use strict";var c=e("path"),l=e("fs"),a=/\!{3}\s*include\s*\(\s*(.+?)\s*\)\s*\!{3}/i;r.exports=function(e,n){e.core.ruler.before("normalize","include",function(e){var r=n||".";e.src=function e(r,n,t,i){var o,u,f,s;for(i=i?i.slice():[],t&&i.push(t);o=a.exec(r);){if(u=c.resolve(n,o[1]),-1!==(s=i.indexOf(u)))throw new Error("Circular reference between "+u+" and "+i[s]);f=e(f=l.readFileSync(u,"utf8"),c.dirname(u),u,i),r=r.slice(0,o.index)+f+r.slice(o.index+o[0].length,r.length)}return r}(e.src,r)})}},{fs:1,path:2}]},{},[4])(4)}); |
{ | ||
"name": "markdown-it-include", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Markdown-it plugin which adds the ability to include markdown fragment files.", | ||
@@ -29,13 +29,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"browserify": "^14.5.0", | ||
"chai": "^4.1.2", | ||
"coveralls": "^2.11.2", | ||
"eslint": "^0.10.2", | ||
"eslint-plugin-nodeca": "^1.0.3", | ||
"istanbul": "^0.4.5", | ||
"markdown-it": "^8.4.0", | ||
"markdown-it-testgen": "^0.1.4", | ||
"mocha": "^4.0.1", | ||
"uglify-js": "^3.2.2" | ||
"browserify": "16.2.3", | ||
"chai": "^4.2.0", | ||
"coveralls": "3.0.2", | ||
"eslint": "5.14.0", | ||
"eslint-plugin-nodeca": "1.0.3", | ||
"istanbul": "0.4.5", | ||
"markdown-it": "8.4.2", | ||
"markdown-it-testgen": "0.1.4", | ||
"mocha": "5.2.0", | ||
"uglify-js": "3.4.9" | ||
} | ||
} |
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
27827
551