Merge pull request #4656 from overleaf/jpa-rewrite-quotes-in-locales

[misc] rewrite single quote to left/right single quotation mark in locales

GitOrigin-RevId: a021fb6841425555b9af79a9146820299cb93fc2
This commit is contained in:
Jakob Ackermann
2021-08-17 08:04:49 +00:00
committed by Copybot
parent 0c0bce71d8
commit 99a414f345
18 changed files with 236 additions and 190 deletions
@@ -53,6 +53,12 @@ run()
* @returns {string}
*/
function sanitize(input) {
// Block Angular XSS
// Ticket: https://github.com/overleaf/issues/issues/4478
input = input.replace(/'/g, '')
// Use left quote where (likely) appropriate.
input.replace(/ /g, ' ')
return sanitizeHtml(input, {
// Allow "replacement" tags (in the format <0>, <1>, <2>, etc) used by
// react-i18next to allow for HTML insertion via the Trans component.