From fa9915d16ffa832f21f2dea7a1b98bba206e315d Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Sat, 23 Sep 2023 15:50:01 +0200 Subject: [PATCH] resolves #1641 Mermaid background on span elements were missing (#1645) --- diagrams.net/src/worker.js | 11 ++++++++++- mermaid/src/worker.js | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/diagrams.net/src/worker.js b/diagrams.net/src/worker.js index dae355fab..5a71fa7aa 100644 --- a/diagrams.net/src/worker.js +++ b/diagrams.net/src/worker.js @@ -64,7 +64,16 @@ export class Worker { // const pageCount = parseInt(await page.mainFrame().$eval('#LoadingComplete', div => div.getAttribute('pageCount'))) if (task.isPng) { - await page.setContent(evalResult.svg) + await page.setContent(` + + + + + + +${evalResult.svg} + +`) const container = await page.$('svg') return await container.screenshot({ type: 'png', diff --git a/mermaid/src/worker.js b/mermaid/src/worker.js index da264d894..253acba37 100644 --- a/mermaid/src/worker.js +++ b/mermaid/src/worker.js @@ -191,7 +191,16 @@ async function toPNG (page, svg) { 'puppeteer' ) try { - await page.setContent(svg) + await page.setContent(` + + + + + + +${svg} + +`) const container = await page.$('#container') const result = await container.screenshot({ type: 'png',