diff --git a/.github/scripts/markdown_example.mjs b/.github/scripts/markdown_example.mjs index 2859015b..d1301b13 100644 --- a/.github/scripts/markdown_example.mjs +++ b/.github/scripts/markdown_example.mjs @@ -13,8 +13,10 @@ const page = await browser.newPage() //Select markdown example and take screenshot await page.setViewport({width: 600, height: 600}) await page.goto("https://github.com/lowlighter/metrics/blob/examples/metrics.markdown.md") +await page.waitForSelector("article.markdown-body") +await new Promise(solve => setTimeout(solve, 4000)) const clip = await page.evaluate(() => { - const {x, y, width, height} = document.querySelector("#readme").getBoundingClientRect() + const {x, y, width, height} = document.querySelector("article.markdown-body").getBoundingClientRect() return {x, y, width, height} }) await page.screenshot({type: "png", path: "/tmp/metrics.markdown.png", clip, omitBackground: true})