#11: Use https://github.com/icza/gox stringsx.Clean to remove non-printable characters
This commit is contained in:
parent
f8e1305c08
commit
abaf731d7e
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
wkhtml "github.com/SebastiaanKlippert/go-wkhtmltopdf"
|
wkhtml "github.com/SebastiaanKlippert/go-wkhtmltopdf"
|
||||||
|
"github.com/icza/gox/stringsx"
|
||||||
"github.com/pdfcpu/pdfcpu/pkg/api"
|
"github.com/pdfcpu/pdfcpu/pkg/api"
|
||||||
"github.com/tidwall/gjson"
|
"github.com/tidwall/gjson"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
@ -418,5 +419,8 @@ func RemoveBadCharacters(input string) string {
|
||||||
for _, badChar := range badCharacters {
|
for _, badChar := range badCharacters {
|
||||||
temp = strings.Replace(temp, badChar, "_", -1)
|
temp = strings.Replace(temp, badChar, "_", -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
temp = stringsx.Clean(temp)
|
||||||
|
|
||||||
return temp
|
return temp
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue