htmlprocessor
Version:
Process html file using special comments
11 lines (8 loc) • 435 B
JavaScript
;
module.exports = remove;
function remove(content, block, blockLine, blockContent) {
var safeBlockLine = blockLine.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
// Replace blockLine with surrounding new line symbols (if present) with empty string
var linefeedStart = content.match(this.linefeed + safeBlockLine) ? this.linefeed : '';
return content.split(linefeedStart + blockLine + this.linefeed).join('');
}