speciale spaties -> gewone spaties
This commit is contained in:
@@ -57,10 +57,10 @@ func main() {
|
||||
var item Item
|
||||
x(xml.Unmarshal(b, &item))
|
||||
for _, cat := range item.Cats {
|
||||
_, err = fmt.Fprintf(fp, "##META text cat = %s\n", cat)
|
||||
_, err = fmt.Fprintf(fp, "##META text cat = %s\n", fixSpace(cat))
|
||||
x(err)
|
||||
}
|
||||
_, err = fp.WriteString(addEnd(item.Title))
|
||||
_, err = fp.WriteString(addEnd(fixSpace(item.Title)))
|
||||
x(err)
|
||||
doc, err := gokogiri.ParseHtml([]byte(`<html><body>` + item.Text + `</body></html>`))
|
||||
x(err)
|
||||
@@ -73,7 +73,7 @@ func main() {
|
||||
pp, err := root.Search(`//body//p[not(.//a[contains(@href,"reportersonline.nl/support")])]`)
|
||||
x(err)
|
||||
for _, p := range pp {
|
||||
_, err = fp.WriteString(addEnd(p.Content()))
|
||||
_, err = fp.WriteString(addEnd(fixSpace(p.Content())))
|
||||
x(err)
|
||||
}
|
||||
x(err)
|
||||
@@ -100,3 +100,7 @@ func addEnd(s string) string {
|
||||
}
|
||||
return s + ".\n"
|
||||
}
|
||||
|
||||
func fixSpace(s string) string {
|
||||
return strings.Join(strings.Fields(s), " ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user