fix renderHtml
This commit is contained in:
parent
f0fc3df881
commit
5d261127af
2 changed files with 6 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
import html2png, { renderHtml as htmlParser } from '@besties/html2png'
|
import html2png from '@besties/html2png'
|
||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
|
|
||||||
const style = fs.readFileSync('./assets/style.css', 'utf8')
|
const style = fs.readFileSync('./assets/style.css', 'utf8')
|
||||||
|
@ -9,5 +9,5 @@ export default async function (html, options = {}) {
|
||||||
|
|
||||||
export async function renderHtml(html) {
|
export async function renderHtml(html) {
|
||||||
const styleNow = await fs.promises.readFile('./assets/style.css', 'utf8')
|
const styleNow = await fs.promises.readFile('./assets/style.css', 'utf8')
|
||||||
return await htmlParser(`<style>${styleNow}</style>${html}`)
|
return `<style>${styleNow}</style>${html}`
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ settings:
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@besties/html2png':
|
'@besties/html2png':
|
||||||
specifier: ^1.0.0
|
specifier: ^1.0.1
|
||||||
version: 1.0.0
|
version: 1.0.1
|
||||||
dotenv:
|
dotenv:
|
||||||
specifier: ^16.3.1
|
specifier: ^16.3.1
|
||||||
version: 16.3.1
|
version: 16.3.1
|
||||||
|
@ -63,8 +63,8 @@ packages:
|
||||||
js-tokens: 4.0.0
|
js-tokens: 4.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@besties/html2png@1.0.0:
|
/@besties/html2png@1.0.1:
|
||||||
resolution: {integrity: sha512-34dB4CxXL5xA/rJtpqI4UVp62DeQf2DQY3t37xSwar1nUde+i8VCCrRb6NfvZK7pz3v7gHk1M4uA7JDZpeWqKw==}
|
resolution: {integrity: sha512-qBkWy66WjvF8hrY2yEzPAIgbyCpTQZI1nt5+KcKg6kZtzvJb1w9GqoGp2MaRKmFTSENyjwK2WYY3CzkI7d49lw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@resvg/resvg-wasm': 2.4.1
|
'@resvg/resvg-wasm': 2.4.1
|
||||||
html-entities: 2.4.0
|
html-entities: 2.4.0
|
||||||
|
|
Loading…
Reference in a new issue