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

Commit

Permalink
Remove redundant blank lines. (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
dianhsu authored Feb 15, 2023
1 parent 17b1ba7 commit 10bf153
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
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

0 comments on commit 10bf153

Please sign in to comment.