Add configurable highlighting style

This commit is contained in:
√(noham)²
2026-06-20 14:50:39 +02:00
parent 158d6b8eab
commit 5ce76ffea6
7 changed files with 43 additions and 27 deletions

View File

@@ -37,7 +37,8 @@ export async function convert (url, options = {}) {
css = null,
prefs = {},
output = null,
browser: externalBrowser = null
browser: externalBrowser = null,
highlightStyle
} = options
if (!VALID_THEMES.includes(theme)) {
@@ -112,7 +113,7 @@ export async function convert (url, options = {}) {
contentHtml = contentHtml.replace(/ loading="lazy"/g, '')
await readerPage.close()
const enhancedHtml = enhanceHtml(contentHtml, css)
const enhancedHtml = enhanceHtml(contentHtml, css, highlightStyle)
const pdfPage = await browser.newPage()
await pdfPage.setViewport({ width: 1280, height: 7200 })