From b20b9759350f5c0e8b6a668d010c45b4b7338ff0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 20 May 2018 20:26:38 +0900 Subject: Fix bug --- src/build/i18n.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/build') diff --git a/src/build/i18n.ts b/src/build/i18n.ts index addc35ce59..35854055d0 100644 --- a/src/build/i18n.ts +++ b/src/build/i18n.ts @@ -7,7 +7,7 @@ import locale from '../../locales'; export default class Replacer { private lang: string; - public pattern = /%i18n:([a-z0-9_\-\.\/\|\!]+?)%/g; + public pattern = /%i18n:([a-z0-9_\-\.\/\|]+?)%/g; constructor(lang: string) { this.lang = lang; @@ -56,11 +56,6 @@ export default class Replacer { public replacement(match, key) { let path = null; - const shouldEscape = key[0] == '!'; - if (shouldEscape) { - key = key.substr(1); - } - if (key.indexOf('|') != -1) { path = key.split('|')[0]; key = key.split('|')[1]; @@ -68,8 +63,6 @@ export default class Replacer { const txt = this.get(path, key); - return shouldEscape - ? txt.replace(/'/g, '\\x27').replace(/"/g, '\\x22') - : txt.replace(/"/g, '"'); + return txt.replace(/'/g, '\\x27').replace(/"/g, '\\x22'); } } -- cgit v1.2.3-freya