remarked
Version:
Markdown parser and lexer. A fork of marked.js maintained for Assemble.
17 lines (13 loc) • 336 B
JavaScript
module.exports = function (regex, options) {
regex = regex.source;
options = options || '';
return function self(name, val) {
if (!name) {
return new RegExp(regex, options);
}
val = val.source || val;
val = val.replace(/(^|[^\[])\^/g, '$1');
regex = regex.replace(name, val);
return self;
};
};