mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
16b6eafcc9
commit
bdf0ef6a67
4 changed files with 6 additions and 4 deletions
|
@ -23,7 +23,7 @@ import { i18n } from '@kbn/i18n';
|
|||
|
||||
export default function replaceVars(str, args = {}, vars = {}) {
|
||||
try {
|
||||
const template = handlebars.compile(str, { strict: true });
|
||||
const template = handlebars.compile(str, { strict: true, knownHelpersOnly: true });
|
||||
|
||||
const string = template(_.assign({}, vars, { args }));
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ const durationsLookup = durationInputOptions.reduce((acc, row) => {
|
|||
|
||||
export default (format = '0,0.[00]', template, getConfig = null) => {
|
||||
if (!template) template = '{{value}}';
|
||||
const render = handlebars.compile(template);
|
||||
const render = handlebars.compile(template, { knownHelpersOnly: true });
|
||||
const durationFormatTest = /[pnumshdwMY]+,[pnumshdwMY]+,\d+/;
|
||||
let formatter;
|
||||
if (durationFormatTest.test(format)) {
|
||||
|
|
|
@ -54,7 +54,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'),
|
||||
|
|
|
@ -30,7 +30,9 @@ export const markdown = () => ({
|
|||
},
|
||||
},
|
||||
fn: (context, args) => {
|
||||
const compileFunctions = args.expression.map(str => Handlebars.compile(String(str)));
|
||||
const compileFunctions = args.expression.map(str =>
|
||||
Handlebars.compile(String(str), { knownHelpersOnly: true })
|
||||
);
|
||||
const ctx = {
|
||||
columns: [],
|
||||
rows: [],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue