Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Unified Diff: ui/webui/resources/js/i18n_behavior.js

Issue 2926573003: [MD settings] allow unicode nbsp in i18n behavior strings (Closed)
Patch Set: reduced comment Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/i18n_behavior_test.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/i18n_behavior.js
diff --git a/ui/webui/resources/js/i18n_behavior.js b/ui/webui/resources/js/i18n_behavior.js
index 95722a1df4ae6be7ae89aeb445fcf76dfb0b510b..89e1d8aa4e5a16757b3ab8ee2620b997a5f7b435 100644
--- a/ui/webui/resources/js/i18n_behavior.js
+++ b/ui/webui/resources/js/i18n_behavior.js
@@ -46,7 +46,10 @@ var I18nBehavior = {
*/
i18n: function(id, var_args) {
var rawString = this.i18nRaw_.apply(this, arguments);
- return parseHtmlSubset('<b>' + rawString + '</b>').firstChild.innerHTML;
+ var htmlStr =
+ parseHtmlSubset('<b>' + rawString + '</b>').firstChild.innerHTML;
+ // TODO(dschuyler): use textContent rather than innerHTML; remove replace().
+ return htmlStr.replace('&nbsp;', '\u00a0');
},
/**
« no previous file with comments | « chrome/test/data/webui/i18n_behavior_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698