Skip to content

Commit

Permalink
fix: 修复txt转换可能会有章节重复的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ystyle committed Jun 21, 2020
1 parent f5c96fc commit ac3b986
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func TextUpload(client *core.WsClient, message core.Message) {
}
}
bookinfo.AddSection(title, content.String())
content.Reset()
break
}
client.WsSend <- core.NewMessage("Error", "参数解析失败")
Expand All @@ -106,6 +107,9 @@ func TextUpload(client *core.WsClient, message core.Message) {
title = "说明"
AddPart(&content, Tutorial)
}
if content.Len() == 0 {
continue
}
bookinfo.AddSection(title, content.String())
title = line
content.Reset()
Expand Down

0 comments on commit ac3b986

Please sign in to comment.