processRawBlocks: cope with empty lists

This commit is contained in:
Michael Teichgräber 2010-11-25 14:33:36 +01:00
parent c5747337a9
commit 722e122c88

View File

@ -87,12 +87,13 @@ func (d *Doc) processRawBlocks(input *element) *element {
current.children = nil
listEnd := &current.children
for _, contents := range strings.Split(current.contents.str, "\001", -1) {
list := d.parseMarkdown(contents)
*listEnd = list
for list.next != nil {
list = list.next
if list := d.parseMarkdown(contents); list != nil {
*listEnd = list
for list.next != nil {
list = list.next
}
listEnd = &list.next
}
listEnd = &list.next
}
current.contents.str = ""
}