- java.lang.Object
-
- org.commonmark.node.Node
-
- org.commonmark.node.Block
-
- org.commonmark.node.ListItem
-
public class ListItem extends Block
A child of aListBlock, containing other blocks (e.g.Paragraph, other lists, etc).Note that a list item can't directly contain
Text, it needs to be:ListItem:Paragraph:Text. If you want a list that is rendered tightly, create a list withListBlock.setTight(boolean).- See Also:
- CommonMark Spec: List items
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.IntegercontentIndentprivate java.lang.IntegermarkerIndent
-
Constructor Summary
Constructors Constructor Description ListItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(Visitor visitor)voidappendChild(Block child)voidappendChild(Node child)Deprecated.list items should only contain block nodes; if you're trying to create a list that is rendered without paragraphs, useListBlock.setTight(boolean)instead.java.lang.IntegergetContentIndent()Returns the indent of the content in columns (spaces or tab stop of 4) if available, or null otherwise.java.lang.IntegergetMarkerIndent()Returns the indent of the marker such as "-" or "1." in columns (spaces or tab stop of 4) if available, or null otherwise.voidsetContentIndent(java.lang.Integer contentIndent)voidsetMarkerIndent(java.lang.Integer markerIndent)-
Methods inherited from class org.commonmark.node.Node
addSourceSpan, getFirstChild, getLastChild, getNext, getPrevious, getSourceSpans, insertAfter, insertBefore, prependChild, setSourceSpans, toString, toStringAttributes, unlink
-
-
-
-
Method Detail
-
getMarkerIndent
public java.lang.Integer getMarkerIndent()
Returns the indent of the marker such as "-" or "1." in columns (spaces or tab stop of 4) if available, or null otherwise.Some examples and their marker indent:
- Foo
Marker indent: 0- Foo
Marker indent: 11. Foo
Marker indent: 2
-
setMarkerIndent
public void setMarkerIndent(java.lang.Integer markerIndent)
-
getContentIndent
public java.lang.Integer getContentIndent()
Returns the indent of the content in columns (spaces or tab stop of 4) if available, or null otherwise. The content indent is counted from the beginning of the line and includes the marker on the first line.Some examples and their content indent:
- Foo
Content indent: 2- Foo
Content indent: 31. Foo
Content indent: 5Note that subsequent lines in the same list item need to be indented by at least the content indent to be counted as part of the list item.
-
setContentIndent
public void setContentIndent(java.lang.Integer contentIndent)
-
appendChild
@Deprecated public void appendChild(Node child)
Deprecated.list items should only contain block nodes; if you're trying to create a list that is rendered without paragraphs, useListBlock.setTight(boolean)instead.- Overrides:
appendChildin classNode
-
appendChild
public void appendChild(Block child)
-
-