class Asciidoctor::ListItem
description (i.e., [[term, term, …], desc]. If a description is not set, then the second entry in the tuple is nil.
In a description list (dlist), each item is a tuple that consists of a 2-item Array of ListItem terms and a ListItem
Public: Methods for managing items for AsciiDoc olists, ulist, and dlists.
def compound?
Primarily relevant for outline lists.
Check whether this list item has compound content (nested blocks aside from a single outline list).
def compound? !simple? end
def fold_first
Internal: Fold the adjacent paragraph block into the list item text
def fold_first @text = @text.nil_or_empty? ? @blocks.shift.source : %(#{@text}#{LF}#{@blocks.shift.source}) nil end
def initialize parent, text = nil
parent - The parent list block for this list item
Public: Initialize an Asciidoctor::ListItem object.
def initialize parent, text = nil super parent, :list_item @text = text @level = parent.level @subs = NORMAL_SUBS.drop 0 end
def simple?
Primarily relevant for outline lists.
Check whether this list item has simple content (no nested blocks aside from a single outline list).
def simple? @blocks.empty? || (@blocks.size == 1 && List === (blk = @blocks[0]) && blk.outline?) end
def text
can be modified by altering the subs property of this object.
By default, normal substitutions are applied to the text. The substitutions
Public: Get the String text of this ListItem with substitutions applied.
def text # NOTE @text can be nil if dd node only has block content @text && (apply_subs @text, @subs) end
def text?
Public: A convenience method that checks whether the text of this list item
def text? @text.nil_or_empty? ? false : true end
def to_s
def to_s %(#<#{self.class}@#{object_id} {list_context: #{parent.context.inspect}, text: #{@text.inspect}, blocks: #{(@blocks || []).size}}>) end