org: Fix drawer & block

- drawer entries without value were printed as FOO rather than :FOO:
- account for differences between raw & non-raw block:
  raw blocks are not wrapped in a further element, just raw text & line breaks:
  -> the first line has to be indented manually
  non raw blocks do not end in a linebreak newline -> the END_BLOCK line has to
  be indented (rather they end with a manual newline from another element)
This commit is contained in:
Niklas Fasching 2018-12-19 12:21:25 +01:00
parent 5f7d28f504
commit 905648c34b
5 changed files with 50 additions and 12 deletions

View file

@ -37,7 +37,7 @@ func (d *Document) parseDrawer(i int, parentStop stopFn) (int, Node) {
i += consumed
drawer.Children = append(drawer.Children, nodes...)
if i < len(d.tokens) && d.tokens[i].kind == "beginDrawer" {
p := Paragraph{[]Node{Text{d.tokens[i].content, false}}}
p := Paragraph{[]Node{Text{":" + d.tokens[i].content + ":", false}}}
drawer.Children = append(drawer.Children, p)
i++
} else {