Package com.vladsch.flexmark.formatter
Class FormatterUtils
- java.lang.Object
-
- com.vladsch.flexmark.formatter.FormatterUtils
-
public class FormatterUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static DataKey<java.lang.Boolean>
FIRST_LIST_ITEM_CHILD
static DataKey<java.util.function.Function<java.lang.CharSequence,Pair<java.lang.Integer,java.lang.Integer>>>
LIST_ALIGN_NUMERIC
static DataKey<java.lang.Integer>
LIST_ITEM_NUMBER
static NullableDataKey<ListSpacing>
LIST_ITEM_SPACING
static java.util.function.Function<java.lang.CharSequence,Pair<java.lang.Integer,java.lang.Integer>>
NULL_PADDING
-
Constructor Summary
Constructors Constructor Description FormatterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
appendWhiteSpaceBetween(MarkdownWriter markdown, Node prev, Node next, boolean preserve, boolean collapse, boolean collapseToEOL)
static void
appendWhiteSpaceBetween(MarkdownWriter markdown, BasedSequence prev, BasedSequence next, boolean preserve, boolean collapse, boolean collapseToEOL)
static java.lang.String
getActualAdditionalPrefix(BasedSequence contentChars, MarkdownWriter markdown)
static java.lang.String
getAdditionalPrefix(BasedSequence fromChars, BasedSequence toChars)
static java.lang.String
getBlockLikePrefix(BlockQuoteLike node, NodeFormatterContext context, BlockQuoteMarker blockQuoteMarkers, BasedSequence prefix)
static BasedSequence
getSoftLineBreakSpan(Node node)
static boolean
isFollowedByBlankLine(Node node)
static boolean
isLastOfItem(Node node)
static boolean
isNotLastItem(Node node)
static void
renderBlockQuoteLike(BlockQuoteLike node, NodeFormatterContext context, MarkdownWriter markdown)
static void
renderList(ListBlock node, NodeFormatterContext context, MarkdownWriter markdown)
static void
renderList(ListBlock node, NodeFormatterContext context, MarkdownWriter markdown, java.util.List<Node> itemList)
static void
renderListItem(ListItem node, NodeFormatterContext context, MarkdownWriter markdown, ListOptions listOptions, BasedSequence markerSuffix, boolean addBlankLineLooseItems)
static void
renderLooseItemParagraph(Paragraph node, NodeFormatterContext context, MarkdownWriter markdown)
static void
renderLooseParagraph(Paragraph node, NodeFormatterContext context, MarkdownWriter markdown)
static void
renderTextBlockParagraphLines(Node node, NodeFormatterContext context, MarkdownWriter markdown)
static java.lang.CharSequence
stripSoftLineBreak(java.lang.CharSequence chars, java.lang.CharSequence spaceChar)
-
-
-
Field Detail
-
LIST_ITEM_NUMBER
public static final DataKey<java.lang.Integer> LIST_ITEM_NUMBER
-
FIRST_LIST_ITEM_CHILD
public static final DataKey<java.lang.Boolean> FIRST_LIST_ITEM_CHILD
-
NULL_PADDING
public static final java.util.function.Function<java.lang.CharSequence,Pair<java.lang.Integer,java.lang.Integer>> NULL_PADDING
-
LIST_ALIGN_NUMERIC
public static final DataKey<java.util.function.Function<java.lang.CharSequence,Pair<java.lang.Integer,java.lang.Integer>>> LIST_ALIGN_NUMERIC
-
LIST_ITEM_SPACING
public static final NullableDataKey<ListSpacing> LIST_ITEM_SPACING
-
-
Method Detail
-
getBlockLikePrefix
public static java.lang.String getBlockLikePrefix(BlockQuoteLike node, NodeFormatterContext context, BlockQuoteMarker blockQuoteMarkers, @NotNull BasedSequence prefix)
-
stripSoftLineBreak
public static java.lang.CharSequence stripSoftLineBreak(java.lang.CharSequence chars, java.lang.CharSequence spaceChar)
-
getActualAdditionalPrefix
@NotNull public static java.lang.String getActualAdditionalPrefix(BasedSequence contentChars, MarkdownWriter markdown)
-
getAdditionalPrefix
@NotNull public static java.lang.String getAdditionalPrefix(BasedSequence fromChars, BasedSequence toChars)
-
getSoftLineBreakSpan
public static BasedSequence getSoftLineBreakSpan(Node node)
-
appendWhiteSpaceBetween
public static void appendWhiteSpaceBetween(MarkdownWriter markdown, Node prev, Node next, boolean preserve, boolean collapse, boolean collapseToEOL)
-
appendWhiteSpaceBetween
public static void appendWhiteSpaceBetween(MarkdownWriter markdown, BasedSequence prev, BasedSequence next, boolean preserve, boolean collapse, boolean collapseToEOL)
-
renderList
public static void renderList(ListBlock node, NodeFormatterContext context, MarkdownWriter markdown)
-
renderList
public static void renderList(ListBlock node, NodeFormatterContext context, MarkdownWriter markdown, java.util.List<Node> itemList)
-
renderLooseParagraph
public static void renderLooseParagraph(Paragraph node, NodeFormatterContext context, MarkdownWriter markdown)
-
isFollowedByBlankLine
public static boolean isFollowedByBlankLine(@Nullable Node node)
-
isNotLastItem
public static boolean isNotLastItem(@Nullable Node node)
-
isLastOfItem
public static boolean isLastOfItem(@Nullable Node node)
-
renderLooseItemParagraph
public static void renderLooseItemParagraph(Paragraph node, NodeFormatterContext context, MarkdownWriter markdown)
-
renderListItem
public static void renderListItem(ListItem node, NodeFormatterContext context, MarkdownWriter markdown, ListOptions listOptions, BasedSequence markerSuffix, boolean addBlankLineLooseItems)
-
renderTextBlockParagraphLines
public static void renderTextBlockParagraphLines(Node node, NodeFormatterContext context, MarkdownWriter markdown)
-
renderBlockQuoteLike
public static void renderBlockQuoteLike(BlockQuoteLike node, NodeFormatterContext context, MarkdownWriter markdown)
-
-