diff options
-rw-r--r-- | src/data/things/language.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/data/things/language.js b/src/data/things/language.js index f8fe0106..0baea81d 100644 --- a/src/data/things/language.js +++ b/src/data/things/language.js @@ -283,10 +283,16 @@ export class Language extends Thing { throw new Error(`escapeHTML unavailable`); } - if (typeof arg === 'string') { - return escapeHTML(arg); - } else { - return arg; + switch (typeof arg) { + case 'string': + return escapeHTML(arg); + + case 'number': + case 'boolean': + return arg.toString(); + + default: + return arg; } } |