refactor debug mode
This commit is contained in:
parent
09d6c4045e
commit
a0cda32d67
3 changed files with 11 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
import html2png from '@besties/html2png'
|
||||
import html2png, { renderHtml as htmlParser } from '@besties/html2png'
|
||||
import fs from 'node:fs'
|
||||
|
||||
const figtreeRegular = fs.readFileSync('./assets/Figtree-Regular.woff')
|
||||
|
@ -33,3 +33,10 @@ const renderOptions = {
|
|||
export default async function (html) {
|
||||
return html2png(html, css, renderOptions)
|
||||
}
|
||||
|
||||
export async function renderHtml(html) {
|
||||
return htmlParser(
|
||||
html,
|
||||
await fs.promises.readFile('./assets/style.css', 'utf8')
|
||||
).outerHTML
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue