diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs index bfc07a0c..917e3c34 100644 --- a/source/app/action/index.mjs +++ b/source/app/action/index.mjs @@ -315,11 +315,11 @@ async function wait(seconds) { //Cache if (/markdown/.test(convert)) { - const regex = /(?)/g + const regex = /(?)/g let matched = null while (matched = regex.exec(rendered)?.groups) { //eslint-disable-line no-cond-assign - const {match, name, content} = matched - let path = `${_markdown_cache}/${name}.svg` + const {match, name, format, content} = matched + let path = `${_markdown_cache}/${name}.${format.replace(/[+].*$/g, "")}` console.debug(`Processing ${path}`) let sha = null try { diff --git a/source/app/metrics/index.mjs b/source/app/metrics/index.mjs index 63fbd0d4..0466b1f9 100644 --- a/source/app/metrics/index.mjs +++ b/source/app/metrics/index.mjs @@ -122,8 +122,8 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf, console.debug(`metrics/compute/${login} > embed called with`) console.debug(q) //Compute rendering - const {rendered} = await metrics({login, q}, {...arguments[1], convert:null}, arguments[2]) - return `` + const {rendered} = await metrics({login, q}, {...arguments[1], convert:["svg", "png", "jpeg"].includes(q["config.output"]) ? q["config.output"] : null}, arguments[2]) + return `` } //Rendering template source let rendered = source.replace(/\{\{ (?[\s\S]*?) \}\}/g, "{%= $ %}")