yoastseo
Version:
Yoast client-side content analysis
25 lines (24 loc) • 920 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
var _transliterationsWPstyle = _interopRequireDefault(require("../../../config/transliterationsWPstyle.js"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
* Replaces all special characters from the text based on the transliterations map specific for WP
* (and different from the one used by YoastSEO.js).
*
* @param {string} text The text to remove special characters from.
* @param {string} locale The locale.
*
* @returns {string} The text with all special characters replaced.
*/
function _default(text, locale) {
const map = (0, _transliterationsWPstyle.default)(locale);
for (let i = map.length - 1; i >= 0; i--) {
text = text.replace(map[i].letter, map[i].alternative);
}
return text;
}
//# sourceMappingURL=transliterateWPstyle.js.map