diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-11-04 18:26:31 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2023-11-04 18:26:31 -0600 |
| commit | 87e75f343a9c85eb6ead48f32d82c60008e2f486 (patch) | |
| tree | eab6526e3638c9590cea8495e9e73b4a0be14574 | |
| parent | df9cfb3c66b2d907154c62c179fb1f374b3193cc (diff) | |
refactor list item line reader so it's more clear when handling list continuation line
| -rw-r--r-- | lib/asciidoctor/parser.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/asciidoctor/parser.rb b/lib/asciidoctor/parser.rb index 2b50aa46..c1983fbf 100644 --- a/lib/asciidoctor/parser.rb +++ b/lib/asciidoctor/parser.rb @@ -1539,13 +1539,18 @@ class Parser buffer << this_line has_text = true end + elsif this_line == LIST_CONTINUATION + has_text = true + buffer << this_line else - has_text = true unless this_line.empty? - if (nested_list_type = (within_nested_list ? [:dlist] : NESTABLE_LIST_CONTEXTS).find {|ctx| ListRxMap[ctx] =~ this_line }) - within_nested_list = true - if nested_list_type == :dlist && $3.nil_or_empty? - # get greedy again - has_text = false + unless this_line.empty? + has_text = true + if (nested_list_type = (within_nested_list ? [:dlist] : NESTABLE_LIST_CONTEXTS).find {|ctx| ListRxMap[ctx] =~ this_line }) + within_nested_list = true + if nested_list_type == :dlist && $3.nil_or_empty? + # get greedy again + has_text = false + end end end buffer << this_line |
