Skip to content
Snippets Groups Projects
Commit 72d129894f79 authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

fix engines priorities so that html->pdf is done by wpd by default (ie, always)

parent d88a04b8410e
No related branches found
No related tags found
No related merge requests found
Release history
===============
0.3.3
-----
- fix engines priorities so that html->pdf is done by wpd by default (ie, always)
0.3.2 (2020-04-22)
------------------
......
......@@ -32,7 +32,7 @@
Type: "Weasyprint",
Description: `Render HTML to PDF with weasyprint.`,
Transitions: []rendering.EngineTransitionInfo{
{FromType: "text/html", ToType: "application/pdf", Priority: 1.0},
{FromType: "text/html", ToType: "application/pdf", Priority: 2.0},
},
Metadata: []rendering.EngineMetadataInfo{
{
......
......@@ -4,6 +4,7 @@
"context"
"errors"
"fmt"
"sort"
)
// ErrDuplicateName is returned by EngineRegistry.Register if and engine with
......@@ -189,6 +190,9 @@
}
}
}
sort.Slice(entries, func(i, j int) bool {
return entries[i].priority > entries[j].priority
})
var engines = make([]Engine, 0, len(entries))
for _, entry := range entries {
engines = append(engines, entry.engine)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment