@wordpress/wordcount
Version:
WordPress word count utility.
24 lines (22 loc) • 569 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = stripShortcodes;
/**
* Internal dependencies
*/
/**
* Replaces items matched in the regex with a new line.
*
* @param settings The main settings object containing regular expressions
* @param text The string being counted.
* @return The manipulated text.
*/
function stripShortcodes(settings, text) {
if (settings.shortcodesRegExp) {
return text.replace(settings.shortcodesRegExp, '\n');
}
return text;
}
//# sourceMappingURL=stripShortcodes.js.map