remark-comments
Advanced tools
Comparing version 1.2.5 to 1.2.6
@@ -1,10 +0,11 @@ | ||
'use strict'; | ||
"use strict"; | ||
var beginMarkerFactory = function beginMarkerFactory() { | ||
var marker = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'COMMENTS'; | ||
return '<--' + marker + ' '; | ||
return "<--".concat(marker, " "); | ||
}; | ||
var endMarkerFactory = function endMarkerFactory() { | ||
var marker = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'COMMENTS'; | ||
return ' ' + marker + '-->'; | ||
return " ".concat(marker, "-->"); | ||
}; | ||
@@ -15,5 +16,5 @@ | ||
_ref$beginMarker = _ref.beginMarker, | ||
beginMarker = _ref$beginMarker === undefined ? 'COMMENTS' : _ref$beginMarker, | ||
beginMarker = _ref$beginMarker === void 0 ? 'COMMENTS' : _ref$beginMarker, | ||
_ref$endMarker = _ref.endMarker, | ||
endMarker = _ref$endMarker === undefined ? 'COMMENTS' : _ref$endMarker; | ||
endMarker = _ref$endMarker === void 0 ? 'COMMENTS' : _ref$endMarker; | ||
@@ -31,6 +32,5 @@ beginMarker = beginMarkerFactory(beginMarker); | ||
if (keepBegin !== 0 || keepEnd === -1) return; | ||
/* istanbul ignore if - never used (yet) */ | ||
/* istanbul ignore if - never used (yet) */ | ||
if (silent) return true; | ||
var comment = value.substring(beginMarker.length, keepEnd); | ||
@@ -40,10 +40,11 @@ return eat(beginMarker + comment + endMarker)({ | ||
value: '', | ||
data: { comment: comment } | ||
data: { | ||
comment: comment | ||
} | ||
}); | ||
} | ||
inlineTokenizer.locator = locator; | ||
var Parser = this.Parser; // Inject inlineTokenizer | ||
var Parser = this.Parser; | ||
// Inject inlineTokenizer | ||
var inlineTokenizers = Parser.prototype.inlineTokenizers; | ||
@@ -53,7 +54,8 @@ var inlineMethods = Parser.prototype.inlineMethods; | ||
inlineMethods.splice(inlineMethods.indexOf('text'), 0, 'comments'); | ||
var Compiler = this.Compiler; | ||
var Compiler = this.Compiler; | ||
if (Compiler) { | ||
var visitors = Compiler.prototype.visitors; | ||
if (!visitors) return; | ||
visitors.comments = function (node) { | ||
@@ -60,0 +62,0 @@ return beginMarker + node.data.comment + endMarker; |
{ | ||
"name": "remark-comments", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"repository": { | ||
@@ -34,3 +34,3 @@ "url": "https://github.com/zestedesavoir/zmarkdown/tree/master/packages/remark-comments", | ||
"license": "MIT", | ||
"gitHead": "1dded309a2670689a4a3353f9e38b80624c6df1a" | ||
"gitHead": "7b61723ac4ca1900270d56c7787c08b6887fcb4c" | ||
} |
7224
88