mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 20:52:14 +01:00
fix(pdfengines): correct merge order - fixes #1168
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package gotenberg
|
package gotenberg
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
@@ -54,6 +55,9 @@ func (s AlphanumericSort) Less(i, j int) bool {
|
|||||||
// If that fails, it then attempts a trailing numeric pattern.
|
// If that fails, it then attempts a trailing numeric pattern.
|
||||||
// If no number is found, it returns -1 and the original string.
|
// If no number is found, it returns -1 and the original string.
|
||||||
func extractNumber(str string) (int, string) {
|
func extractNumber(str string) (int, string) {
|
||||||
|
// See https://github.com/gotenberg/gotenberg/issues/1168.
|
||||||
|
str = filepath.Base(str)
|
||||||
|
|
||||||
// Check for a numeric prefix.
|
// Check for a numeric prefix.
|
||||||
if matches := prefixRegexp.FindStringSubmatch(str); len(matches) > 2 {
|
if matches := prefixRegexp.FindStringSubmatch(str); len(matches) > 2 {
|
||||||
if num, err := strconv.Atoi(matches[1]); err == nil {
|
if num, err := strconv.Atoi(matches[1]); err == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user