Merge pull request #1915 from eikek/fix-weasyprint-text-files

Fix html conversion for text files
This commit is contained in:
mergify[bot] 2023-01-09 17:31:27 +00:00 committed by GitHub
commit a943e6d977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,13 +82,26 @@ object Conversion {
Chunk.byteVector(ByteVector.view(html.getBytes(StandardCharsets.UTF_8))) Chunk.byteVector(ByteVector.view(html.getBytes(StandardCharsets.UTF_8)))
) )
.covary[F] .covary[F]
WkHtmlPdf.toPDF( cfg.htmlConverter match {
cfg.wkhtmlpdf, case HtmlConverter.Wkhtmltopdf =>
cfg.chunkSize, WkHtmlPdf.toPDF(
StandardCharsets.UTF_8, cfg.wkhtmlpdf,
sanitizeHtml, cfg.chunkSize,
logger StandardCharsets.UTF_8,
)(bytes, handler) sanitizeHtml,
logger
)(bytes, handler)
case HtmlConverter.Weasyprint =>
Weasyprint.toPDF(
cfg.weasyprint,
cfg.chunkSize,
StandardCharsets.UTF_8,
sanitizeHtml,
logger
)(bytes, handler)
}
} }
case MimeType.ImageMatch(mt) => case MimeType.ImageMatch(mt) =>