Skip to content

Commit

Permalink
dehyphen: remove chars PDFium leaves after dehyphenation
Browse files Browse the repository at this point in the history
  • Loading branch information
johbar committed Jul 28, 2024
1 parent 5ac4fd3 commit 12b60d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dehyphenator/dehyphen.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func Dehyphenate(in io.Reader, out bufio.Writer) error {
s := bufio.NewScanner(in)
defer out.Flush()
for s.Scan() {
currentLine := s.Text()
currentLine := strings.ReplaceAll(s.Text(), "\uFFFE", "")
if trimmed := []rune(strings.TrimSpace(currentLine)); len(trimmed) == 0 || (len(trimmed) >= 1 && isHyphen(trimmed[0])) {
// Skip empty and hyphen-only lines
continue
Expand Down

0 comments on commit 12b60d0

Please sign in to comment.