remark-custom-blocks
Advanced tools
Comparing version 2.5.1 to 2.6.0
@@ -7,3 +7,3 @@ "use strict"; | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
@@ -20,3 +20,3 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
@@ -78,9 +78,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
var _keep = _slicedToArray(keep, 3), | ||
var _keep = _slicedToArray(keep, 2), | ||
eaten = _keep[0], | ||
blockType = _keep[1], | ||
blockTitle = _keep[2]; | ||
blockType = _keep[1]; | ||
var potentialBlock = availableBlocks[blockType]; | ||
var blockTitle = keep[2] || potentialBlock.defaultTitle; | ||
/* istanbul ignore if - never used (yet) */ | ||
if (silent) return true; | ||
@@ -105,3 +106,2 @@ var linesToEat = []; | ||
var stringToEat = eaten + linesToEat.join(C_NEWLINE); | ||
var potentialBlock = availableBlocks[blockType]; | ||
var titleAllowed = potentialBlock.title && ['optional', 'required'].includes(potentialBlock.title); | ||
@@ -108,0 +108,0 @@ var titleRequired = potentialBlock.title && potentialBlock.title === 'required'; |
{ | ||
"name": "remark-custom-blocks", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"repository": { | ||
@@ -34,3 +34,3 @@ "url": "https://github.com/zestedesavoir/zmarkdown/tree/master/packages/remark-custom-blocks", | ||
}, | ||
"gitHead": "7dfdfdf98ac64c3867791036ab0cf1ce45918e40" | ||
"gitHead": "e2c975ab153bdb0d205275ac7bf71f788ee1590d" | ||
} |
@@ -51,6 +51,10 @@ const spaceSeparated = require('space-separated-tokens') | ||
const keep = regex.exec(value) | ||
if (!keep) return | ||
if (keep.index !== 0) return | ||
const [eaten, blockType, blockTitle] = keep | ||
const [eaten, blockType] = keep | ||
const potentialBlock = availableBlocks[blockType] | ||
const blockTitle = keep[2] || potentialBlock.defaultTitle | ||
/* istanbul ignore if - never used (yet) */ | ||
@@ -76,6 +80,4 @@ if (silent) return true | ||
const contentString = content.join(C_NEWLINE) | ||
const stringToEat = eaten + linesToEat.join(C_NEWLINE) | ||
const potentialBlock = availableBlocks[blockType] | ||
const titleAllowed = potentialBlock.title && | ||
@@ -144,5 +146,8 @@ ['optional', 'required'].includes(potentialBlock.title) | ||
const blockMethods = Parser.prototype.blockMethods | ||
blockTokenizers.customBlocks = blockTokenizer | ||
blockMethods.splice(blockMethods.indexOf('fencedCode') + 1, 0, 'customBlocks') | ||
const Compiler = this.Compiler | ||
if (Compiler) { | ||
@@ -158,2 +163,3 @@ const visitors = Compiler.prototype.visitors | ||
} | ||
// Inject into interrupt rules | ||
@@ -163,2 +169,3 @@ const interruptParagraph = Parser.prototype.interruptParagraph | ||
const interruptBlockquote = Parser.prototype.interruptBlockquote | ||
interruptParagraph.splice(interruptParagraph.indexOf('fencedCode') + 1, 0, ['customBlocks']) | ||
@@ -165,0 +172,0 @@ interruptList.splice(interruptList.indexOf('fencedCode') + 1, 0, ['customBlocks']) |
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
20656
287