mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Fix several bugs with handling e-mail files
- When converting from html->pdf, the wkhtmltopdf program exits with errors if the document contains invalid links. The content is now cleaned before handed to wkhtmltopdf. - Update emil library which fixes a bug when reading mails without explicit transfer encoding (8bit) - Add a info header to converted mails
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package docspell.common
|
||||
|
||||
import cats.effect._
|
||||
import fs2.{Chunk, Pipe, Stream}
|
||||
import java.nio.charset.Charset
|
||||
import java.nio.charset.StandardCharsets
|
||||
@ -42,6 +43,9 @@ object Binary {
|
||||
util.decode[F](cs)
|
||||
}
|
||||
|
||||
def loadAllBytes[F[_]: Sync](data: Stream[F, Byte]): F[ByteVector] =
|
||||
data.chunks.map(_.toByteVector).compile.fold(ByteVector.empty)((r, e) => r ++ e)
|
||||
|
||||
// This is a copy from org.http4s.util
|
||||
// Http4s is licensed under the Apache License 2.0
|
||||
private object util {
|
||||
@ -85,5 +89,6 @@ object Binary {
|
||||
if (chunk.size >= 3 && chunk.take(3) == utf8Bom) {
|
||||
chunk.drop(3)
|
||||
} else chunk
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user