From 213da0beff2a863c01ef7c7b86dbf8f0b57b8b50 Mon Sep 17 00:00:00 2001 From: Niklas Fasching Date: Mon, 3 Dec 2018 19:27:57 +0100 Subject: [PATCH] Fix list parsing & ensure line breaks inside lists are handled correctly - Break list when kind of bullet changes - Ensure we render multiline list items correctly --- org/list.go | 2 +- org/testdata/example.html | 32 ++++++++++++++++++++++++++++++++ org/testdata/example.org | 12 ++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/org/list.go b/org/list.go index f8362f2..3ff2214 100644 --- a/org/list.go +++ b/org/list.go @@ -54,7 +54,7 @@ func (d *Document) parseList(i int, parentStop stopFn) (int, Node) { start, lvl := i, d.tokens[i].lvl list := List{Kind: listKind(d.tokens[i])} - for !parentStop(d, i) && d.tokens[i].lvl == lvl && isListToken(d.tokens[i]) { + for !parentStop(d, i) && d.tokens[i].lvl == lvl && isListToken(d.tokens[i]) && listKind(d.tokens[i]) == list.Kind { consumed, node := d.parseListItem(i, parentStop) i += consumed list.Items = append(list.Items, node) diff --git a/org/testdata/example.html b/org/testdata/example.html index da65ee7..88b2943 100644 --- a/org/testdata/example.html +++ b/org/testdata/example.html @@ -253,6 +253,38 @@ either this or that foo. either this or that foo.

+

#50: Linebreaks in lists are preserved

+ +
    +
  1. +

    +same +goes +for +ordered +lists +

    +
  2. +
  3. +

    +foo +

    +
  4. +

#68: Quote block with inline markup

diff --git a/org/testdata/example.org b/org/testdata/example.org index a7d37f8..f40eb58 100644 --- a/org/testdata/example.org +++ b/org/testdata/example.org @@ -120,6 +120,18 @@ crazy ain't it? either ~this~ or ~that~ foo. either ~this~ or ~that~ foo. +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/50][#50]]: Linebreaks in lists are preserved +- this list item + has + multiple + linbreaks - but it's still just one paragraph (i.e. no line breaks are rendered) +- foobar +1. same + goes + for + ordered + lists +2. foo *** DONE [[https://github.com/chaseadamsio/goorgeous/issues/68][#68]]: Quote block with inline markup #+BEGIN_QUOTE [[https://www.example.com][/this/ *is* _markup_!]]