Don't add children from items
All checks were successful
the build was successful

This commit is contained in:
Peter Stuifzand 2018-09-08 13:56:59 +02:00
parent 348fc5f33f
commit 3b8ada2852
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -176,19 +176,20 @@ func SimplifyMicroformatData(md *microformats.Data) []map[string]interface{} {
}
newItem := SimplifyMicroformat(item, nil)
if newItem["type"] == "entry" || newItem["type"] == "event" || newItem["type"] == "card" {
items = append(items, newItem)
}
if c, e := newItem["children"]; e {
if ar, ok := c.([]map[string]interface{}); ok {
for _, item := range ar {
if item["type"] == "entry" || item["type"] == "event" || item["type"] == "card" {
items = append(items, item)
}
}
}
delete(newItem, "children")
}
delete(newItem, "children")
// if newItem["type"] == "entry" || newItem["type"] == "event" || newItem["type"] == "card" {
// items = append(items, newItem)
// }
// if c, e := newItem["children"]; e {
// if ar, ok := c.([]map[string]interface{}); ok {
// for _, item := range ar {
// if item["type"] == "entry" || item["type"] == "event" || item["type"] == "card" {
// items = append(items, item)
// }
// }
// }
// delete(newItem, "children")
// }
}
return items
}