Skip to content

Commit

Permalink
escape
Browse files Browse the repository at this point in the history
  • Loading branch information
satkunas committed Feb 28, 2025
1 parent 0069add commit fd0a442
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions html/pfappserver/root/src/utils/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ export default class CustomFormatter {
}

interpolate (message, values) {
let escaped = MessageFormat.escape(message)
// reference cache
let fn = this._caches[message]
let fn = this._caches[escaped]
if (!fn) {
// no cache, compile once
fn = this._formatter.compile(message, this._locale)
fn = this._formatter.compile(escaped, this._locale)
// cache
this._caches[message] = fn
this._caches[escaped] = fn
}
return [fn(values)]
}
Expand Down

0 comments on commit fd0a442

Please sign in to comment.