mirror of
https://github.com/bestnite/bilinovel-downloader.git
synced 2025-10-26 01:01:35 +00:00
fix: trim whitespace from text before writing to chapter file
This commit is contained in:
@@ -46,7 +46,7 @@ func PackVolumeToText(volume *model.Volume, outputPath string) error {
|
|||||||
}
|
}
|
||||||
doc.Find("img").Remove()
|
doc.Find("img").Remove()
|
||||||
text := doc.Text()
|
text := doc.Text()
|
||||||
_, err = chapterFile.WriteString(text)
|
_, err = chapterFile.WriteString(strings.TrimSpace(text))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to write chapter file: %v", err)
|
return fmt.Errorf("failed to write chapter file: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user