yoastseo
Version:
Yoast client-side content analysis
24 lines (22 loc) • 858 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
// Replace all other punctuation characters at the beginning or at the end of a word.
const punctuationRegexString = "[\\–\\-\\(\\)_\\[\\]’'.?!:;,¿¡«»‹›\u2014\u00d7\u002b\u0026<>]+";
const punctuationRegexStart = new RegExp("^" + punctuationRegexString);
const punctuationRegexEnd = new RegExp(punctuationRegexString + "$");
/**
* Replaces punctuation characters at the beginning and end of a given text string.
*
* @param {String} text The text to remove the punctuation characters for.
*
* @returns {String} The sanitized text.
*/
function _default(text) {
text = text.replace(punctuationRegexStart, "");
text = text.replace(punctuationRegexEnd, "");
return text;
}
//# sourceMappingURL=removePunctuationExceptQuotes.js.map