Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Remove redundant blank lines. #5

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea/
dist/
dist/
GOPATH/
cf/
4 changes: 3 additions & 1 deletion .idea/cf-tool.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions client/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ func findSample(body []byte) (input [][]byte, output [][]byte, err error) {
// For each item found, get the title
inputCase := ""
s.Find("pre").Contents().Each(func(_ int, s1 *goquery.Selection) {
//fmt.Println(s1.Text())
inputCase += s1.Text() + "\n"
if !s1.Is("br") {
inputCase += s1.Text() + "\n"
}
})
for strings.HasSuffix(inputCase, "\n\n") {
inputCase = inputCase[:len(inputCase)-1]
Expand All @@ -31,8 +32,9 @@ func findSample(body []byte) (input [][]byte, output [][]byte, err error) {
// For each item found, get the title
outputCase := ""
s.Find("pre").Contents().Each(func(_ int, s1 *goquery.Selection) {
//fmt.Println(s1.Text())
outputCase += s1.Text() + "\n"
if !s1.Is("br") {
outputCase += s1.Text() + "\n"
}
})
for strings.HasSuffix(outputCase, "\n\n") {
outputCase = outputCase[:len(outputCase)-1]
Expand Down