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_CHILDstatic DataKey<java.util.function.Function<java.lang.CharSequence,Pair<java.lang.Integer,java.lang.Integer>>>LIST_ALIGN_NUMERICstatic DataKey<java.lang.Integer>LIST_ITEM_NUMBERstatic NullableDataKey<ListSpacing>LIST_ITEM_SPACINGstatic 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 voidappendWhiteSpaceBetween(MarkdownWriter markdown, Node prev, Node next, boolean preserve, boolean collapse, boolean collapseToEOL)static voidappendWhiteSpaceBetween(MarkdownWriter markdown, BasedSequence prev, BasedSequence next, boolean preserve, boolean collapse, boolean collapseToEOL)static @NotNull java.lang.StringgetActualAdditionalPrefix(BasedSequence contentChars, MarkdownWriter markdown)static @NotNull java.lang.StringgetAdditionalPrefix(BasedSequence fromChars, BasedSequence toChars)static java.lang.StringgetBlockLikePrefix(BlockQuoteLike node, NodeFormatterContext context, BlockQuoteMarker blockQuoteMarkers, @NotNull BasedSequence prefix)static BasedSequencegetSoftLineBreakSpan(Node node)(package private) static booleanhasLooseItems(java.lang.Iterable<Node> itemList)static booleanisFollowedByBlankLine(@Nullable Node node)static booleanisLastOfItem(@Nullable Node node)static booleanisNotLastItem(@Nullable Node node)static voidrenderBlockQuoteLike(BlockQuoteLike node, NodeFormatterContext context, MarkdownWriter markdown)static voidrenderList(ListBlock node, NodeFormatterContext context, MarkdownWriter markdown)static voidrenderList(ListBlock node, NodeFormatterContext context, MarkdownWriter markdown, java.util.List<Node> itemList)static voidrenderListItem(ListItem node, NodeFormatterContext context, MarkdownWriter markdown, ListOptions listOptions, BasedSequence markerSuffix, boolean addBlankLineLooseItems)static voidrenderLooseItemParagraph(Paragraph node, NodeFormatterContext context, MarkdownWriter markdown)static voidrenderLooseParagraph(Paragraph node, NodeFormatterContext context, MarkdownWriter markdown)static voidrenderTextBlockParagraphLines(Node node, NodeFormatterContext context, MarkdownWriter markdown)static java.lang.CharSequencestripSoftLineBreak(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 @NotNull BasedSequence prefix)
-
stripSoftLineBreak
public static java.lang.CharSequence stripSoftLineBreak(java.lang.CharSequence chars, java.lang.CharSequence spaceChar)
-
getActualAdditionalPrefix
@NotNull public static @NotNull java.lang.String getActualAdditionalPrefix(BasedSequence contentChars, MarkdownWriter markdown)
-
getAdditionalPrefix
@NotNull public static @NotNull 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 @Nullable Node node)
-
isNotLastItem
public static boolean isNotLastItem(@Nullable @Nullable Node node)
-
isLastOfItem
public static boolean isLastOfItem(@Nullable @Nullable Node node)
-
renderLooseItemParagraph
public static void renderLooseItemParagraph(Paragraph node, NodeFormatterContext context, MarkdownWriter markdown)
-
hasLooseItems
static boolean hasLooseItems(java.lang.Iterable<Node> itemList)
-
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)
-
-