mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
f909937e01
commit
59ab496fbf
3 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@ import _ from 'lodash';
|
|||
import handlebars from 'handlebars/dist/handlebars';
|
||||
export default function replaceVars(str, args = {}, vars = {}) {
|
||||
try {
|
||||
const template = handlebars.compile(str);
|
||||
const template = handlebars.compile(str, { knownHelpersOnly: true });
|
||||
return template(_.assign({}, vars, { args }));
|
||||
} catch (e) {
|
||||
return str;
|
||||
|
|
|
@ -10,7 +10,7 @@ const formatLookup = {
|
|||
|
||||
export default (format = '0,0.[00]', template) => {
|
||||
if (!template) template = '{{value}}';
|
||||
const render = handlebars.compile(template);
|
||||
const render = handlebars.compile(template, { knownHelpersOnly: true });
|
||||
return (val) => {
|
||||
const formatString = formatLookup[format] || format;
|
||||
let value;
|
||||
|
|
|
@ -37,7 +37,7 @@ async function buildGallery(comparisons) {
|
|||
|
||||
const template = Handlebars.compile(await readFileAsync(
|
||||
path.resolve('./utilities/templates/visual_regression_gallery.handlebars')
|
||||
, 'utf8'));
|
||||
, 'utf8'), { knownHelpersOnly: true });
|
||||
|
||||
const html = template({
|
||||
date: moment().format('MMMM Do YYYY, h:mm:ss a'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue