Skip to content

XUICEMarkdownFormatter

Implements MarkdownKit.MKRenderer, XUICEFormatter

Description

A CommonMark-compliant Markdown formatter for the XUICodeEditor.

Properties

Name Type Read-Only
ATXHeadingLevel Integer
InEmphasis Boolean
InStrongEmphasis Boolean
IsWithinATXHeading Boolean
IsWithinCodeSpan Boolean
IsWithinSetextHeading Boolean
mDoc MarkdownKit.MKDocument
mLines() XUICELine
mParser MarkdownKit.MKParser
SetextHeadingLevel Integer

Methods

Name Parameters Returns
AllowsLeadingWhitespace Boolean
HandleReferenceLinkDefinitions doc As MarkdownKit.MKDocument
IsCommentLine line As XUICELine Boolean
Name String
NearestDelimitersForCaretPos caretPos As Integer XUICEDelimiter
Parse lines() As XUICELine
SupportsDelimiterHighlighting Boolean
SupportsUnmatchedBlockHighlighting Boolean
TokenIsComment token As XUICELineToken Boolean
Tokenise lines() As XUICELine, firstVisibleLineNumber As Integer, lastVisibleLineNumber As Integer
TokeniseAll lines() As XUICELine
TokenTypes String()
VisitATXHeading atx As MarkdownKit.MKATXHeadingBlock Variant
VisitBlock b As MarkdownKit.MKBlock Variant
VisitBlockQuote bq As MarkdownKit.MKBlockQuote Variant
VisitCodeSpan cs As MarkdownKit.MKCodeSpan Variant
VisitDocument doc As MarkdownKit.MKDocument Variant
VisitEmphasis e As MarkdownKit.MKEmphasis Variant
VisitFencedCode fc As MarkdownKit.MKFencedCodeBlock Variant
VisitHTMLBlock html As MarkdownKit.MKHTMLBlock Variant
VisitIndentedCode ic As MarkdownKit.MKIndentedCodeBlock Variant
VisitInlineHTML html As MarkdownKit.MKInlineHTML Variant
VisitInlineImage image As MarkdownKit.MKInlineImage Variant
VisitInlineLink link As MarkdownKit.MKInlineLink Variant
VisitInlineText it As MarkdownKit.MKInlineText Variant
VisitList list As MarkdownKit.MKListBlock Variant
VisitListItem item As MarkdownKit.MKListItemBlock Variant
VisitParagraph p As MarkdownKit.MKParagraphBlock Variant
VisitSetextHeading stx As MarkdownKit.MKSetextHeadingBlock Variant
VisitSoftBreak sb As MarkdownKit.MKSoftBreak Variant
VisitStrongEmphasis se As MarkdownKit.MKStrongEmphasis Variant
VisitTextBlock tb As MarkdownKit.MKTextBlock Variant
VisitThematicBreak tb As MarkdownKit.MKThematicBreak Variant

Constants

Name Type
TOKEN_ATX_DELIMITER_LEVEL1 String
TOKEN_ATX_DELIMITER_LEVEL2 String
TOKEN_ATX_DELIMITER_LEVEL3 String
TOKEN_ATX_DELIMITER_LEVEL4 String
TOKEN_ATX_DELIMITER_LEVEL5 String
TOKEN_ATX_DELIMITER_LEVEL6 String
TOKEN_ATX_LEVEL1 String
TOKEN_ATX_LEVEL2 String
TOKEN_ATX_LEVEL3 String
TOKEN_ATX_LEVEL4 String
TOKEN_ATX_LEVEL5 String
TOKEN_ATX_LEVEL6 String
TOKEN_BLOCKQUOTE_DELIMITER String
TOKEN_CODESPAN String
TOKEN_CODESPAN_DELIMITER String
TOKEN_CODE_LINE String
TOKEN_DEFAULT String
TOKEN_EMPHASIS String
TOKEN_EMPHASIS_DELIMITER String
TOKEN_FENCE_DELIMITER String
TOKEN_INFO_STRING String
TOKEN_INLINE_HTML String
TOKEN_INLINE_LINK_LABEL String
TOKEN_LINK_DESTINATION String
TOKEN_LINK_DESTINATION_DELIMITER String
TOKEN_LINK_LABEL_DELIMITER String
TOKEN_LINK_TITLE String
TOKEN_LINK_TITLE_DELIMITER String
TOKEN_LIST_MARKER String
TOKEN_SETEXTUNDERLINE_LEVEL1 String
TOKEN_SETEXTUNDERLINE_LEVEL2 String
TOKEN_SETEXT_LEVEL1 String
TOKEN_SETEXT_LEVEL2 String
TOKEN_STRONG String
TOKEN_STRONG_AND_EMPHASIS String
TOKEN_STRONG_DELIMITER String
TOKEN_THEMATIC_BREAK String

TOKEN_ATX_DELIMITER_LEVEL1 As String The token type used for level 1 ATX heading delimiters.


TOKEN_ATX_DELIMITER_LEVEL2 As String The token type used for level 2 ATX heading delimiters.


TOKEN_ATX_DELIMITER_LEVEL3 As String The token type used for level 3 ATX heading delimiters.


TOKEN_ATX_DELIMITER_LEVEL4 As String The token type used for level 4 ATX heading delimiters.


TOKEN_ATX_DELIMITER_LEVEL5 As String The token type used for level 5 ATX heading delimiters.


TOKEN_ATX_DELIMITER_LEVEL6 As String The token type used for level 6 ATX heading delimiters.


TOKEN_ATX_LEVEL1 As String The token type used for level 1 ATX heading text.


TOKEN_ATX_LEVEL2 As String The token type used for level 2 ATX heading text.


TOKEN_ATX_LEVEL3 As String The token type used for level 3 ATX heading text.


TOKEN_ATX_LEVEL4 As String The token type used for level 4 ATX heading text.


TOKEN_ATX_LEVEL5 As String The token type used for level 5 ATX heading text.


TOKEN_ATX_LEVEL6 As String The token type used for level 6 ATX heading text.


TOKEN_BLOCKQUOTE_DELIMITER As String Used for block quote delimiters (>).


TOKEN_CODESPAN As String Used for text within a code span.


TOKEN_CODESPAN_DELIMITER As String Used for codespan delimiters (`).


TOKEN_CODE_LINE As String Used for code lines in indented and fenced code blocks.


TOKEN_DEFAULT As String Used for default text.


TOKEN_EMPHASIS As String Used for emphasis inline text.


TOKEN_EMPHASIS_DELIMITER As String Used for emphasis delimiters (e.g: * and _).


TOKEN_FENCE_DELIMITER As String Used for the delimiters around code fences (``` and ~~~).


TOKEN_INFO_STRING As String Used for info strings in code fences.


TOKEN_INLINE_HTML As String Used for inline HTML (e.g: <a>).


TOKEN_INLINE_LINK_LABEL As String Used for the text of inline link and image labels. For example: ![linkLabel](destination).


TOKEN_LINK_DESTINATION As String Used for inline and reference link destinations.


TOKEN_LINK_DESTINATION_DELIMITER As String Used for the delimiters around the destination in inline links and images.


TOKEN_LINK_LABEL_DELIMITER As String Used for the delimiters around inline and reference definition link labels ([ and ]).


TOKEN_LINK_TITLE As String Used for inline link and image titles.


TOKEN_LINK_TITLE_DELIMITER As String Used for the delimiters around link titles in inline links and images ([ and ]).


TOKEN_LIST_MARKER As String Used for list markers (e.g: -, 1., +, etc).


TOKEN_SETEXTUNDERLINE_LEVEL1 As String The token type used for the underlining of level 1 setext headings.


TOKEN_SETEXTUNDERLINE_LEVEL2 As String The token type used for the underlining of level 2 setext headings.


TOKEN_SETEXT_LEVEL1 As String The token type used for level 1 setext headings.


TOKEN_SETEXT_LEVEL2 As String The token type used for level 2 setext headings.


TOKEN_STRONG As String Used for strong emphasis inline text.


TOKEN_STRONG_AND_EMPHASIS As String Used for combined strong emphasis and emphasis inline text (e.g: ***hello***).


TOKEN_STRONG_DELIMITER As String Used for strong emphasis delimiters (e.g: ** and __).


TOKEN_THEMATIC_BREAK As String Used for thematic breaks.


Property Descriptions

ATXHeadingLevel As Integer

If the renderer is currently within an ATX heading, this is its level.


InEmphasis As Boolean

True if the renderer is currently within emphasis.


InStrongEmphasis As Boolean

True if the renderer is currently within strong emphasis.


IsWithinATXHeading As Boolean

True if the renderer is currently within an ATX heading.


IsWithinCodeSpan As Boolean

True if the renderer is currently within a code span.


IsWithinSetextHeading As Boolean

True if the renderer is currently within a setext heading.


mDoc As MarkdownKit.MKDocument

The last parsed Markdown document (AST).


mLines() As XUICELine

A reference to the lines to tokenise.


mParser As MarkdownKit.MKParser

Internal Markdown parser.


SetextHeadingLevel As Integer

If the renderer is currently within a setext heading, this is its level.


Method Descriptions

AllowsLeadingWhitespace() As Boolean

True if this formatter allows whitespace at the beginning of a line. If False, the editor will strip it when pasting and prevent it from being typed.

Part of the XUICEFormatter interface.


HandleReferenceLinkDefinitions(doc As MarkdownKit.MKDocument)

Adds tokens for any reference link definitions in the document.


IsCommentLine(line As XUICELine) As Boolean

True if this entire line is a comment.

There are no comment lines in the plain text formatter.


Name() As String

The name of this formatter.


NearestDelimitersForCaretPos(caretPos As Integer) As XUICEDelimiter

Does nothing in Markdown documents.

Part of the XUICEFormatter interface. Used to return the nearest delimiters at the given caretPos. May be Nil.


Parse(lines() As XUICELine)

Called periodically by the editor. An opportunity to parse the tokenised lines. Will always be called after the lines have been tokenised.

Part of the XUICEFormatter interface.


SupportsDelimiterHighlighting() As Boolean

True if this formatter supports highlighting the delimiters around the caret.

Part of the XUICEFormatter interface.


SupportsUnmatchedBlockHighlighting() As Boolean

True if this formatter highlights unmatched blocks.

Part of the XUICEFormatter interface.


TokenIsComment(token As XUICELineToken) As Boolean

True if token is considered to be a comment.


Tokenise(lines() As XUICELine, firstVisibleLineNumber As Integer, lastVisibleLineNumber As Integer)

Tokenises a portion of lines.

Note that we tokenise all lines, even though this method is passed the visible line numbers.

Part of the XUIFormatter interface.


TokeniseAll(lines() As XUICELine)

Tokenises an array of lines.

Part of the XUICEFormatter interface.


TokenTypes() As String()

Returns an array of all token types used by this formatter.


VisitATXHeading(atx As MarkdownKit.MKATXHeadingBlock) As Variant

The renderer is visiting an ATX heading.

Part of the MarkdownKit.MKRenderer interface.


VisitBlock(b As MarkdownKit.MKBlock) As Variant

The renderer is visiting a block.

Part of the MarkdownKit.MKRenderer interface.


VisitBlockQuote(bq As MarkdownKit.MKBlockQuote) As Variant

The renderer is visiting a block quote.

Part of the MarkdownKit.MKRenderer interface.


VisitCodeSpan(cs As MarkdownKit.MKCodeSpan) As Variant

The renderer is visiting a code span.

Part of the MarkdownKit.MKRenderer interface.


VisitDocument(doc As MarkdownKit.MKDocument) As Variant

The renderer is visiting a Markdown document.

Part of the MarkdownKit.MKRenderer interface.


VisitEmphasis(e As MarkdownKit.MKEmphasis) As Variant

The renderer is visiting an emphasis node.

Part of the MarkdownKit.MKRenderer interface.


VisitFencedCode(fc As MarkdownKit.MKFencedCodeBlock) As Variant

The renderer is visiting some fenced code.

Part of the MarkdownKit.MKRenderer interface.


VisitHTMLBlock(html As MarkdownKit.MKHTMLBlock) As Variant

The renderer is visiting an HTML block.

Part of the MarkdownKit.MKRenderer interface.


VisitIndentedCode(ic As MarkdownKit.MKIndentedCodeBlock) As Variant

The renderer is visiting some indented code.

Part of the MarkdownKit.MKRenderer interface.


VisitInlineHTML(html As MarkdownKit.MKInlineHTML) As Variant

The renderer is visiting some inline HTML. code.

Part of the MarkdownKit.MKRenderer interface.


VisitInlineImage(image As MarkdownKit.MKInlineImage) As Variant

The renderer is visiting an inline image.

Part of the MarkdownKit.MKRenderer interface.

Link types:

Shortcut: `![foo]`
Collapsed: `![foo][]`
Full: `![foo](foo.com)`

VisitInlineLink(link As MarkdownKit.MKInlineLink) As Variant

The renderer is visiting an inline link.

Part of the MarkdownKit.MKRenderer interface.

Link types:

Shortcut: `[foo]`
Collapsed: `[foo][]`
Full: `[foo](foo.com)`

VisitInlineText(it As MarkdownKit.MKInlineText) As Variant

The renderer is visiting some inline text.

Part of the MarkdownKit.MKRenderer interface.


VisitList(list As MarkdownKit.MKListBlock) As Variant

The renderer is visiting a list.

Part of the MarkdownKit.MKRenderer interface.


VisitListItem(item As MarkdownKit.MKListItemBlock) As Variant

The renderer is visiting a list item.

Part of the MarkdownKit.MKRenderer interface.


VisitParagraph(p As MarkdownKit.MKParagraphBlock) As Variant

The renderer is visiting a paragraph block.

Part of the MarkdownKit.MKRenderer interface.


VisitSetextHeading(stx As MarkdownKit.MKSetextHeadingBlock) As Variant

The renderer is visiting a setext heading.

Part of the MarkdownKit.MKRenderer interface.


VisitSoftBreak(sb As MarkdownKit.MKSoftBreak) As Variant

The renderer is visiting a soft break.

Part of the MarkdownKit.MKRenderer interface.


VisitStrongEmphasis(se As MarkdownKit.MKStrongEmphasis) As Variant

The renderer is visiting a strong emphasis node.

Part of the MarkdownKit.MKRenderer interface.


VisitTextBlock(tb As MarkdownKit.MKTextBlock) As Variant

The renderer is visiting a text block.

Part of the MarkdownKit.MKRenderer interface.


VisitThematicBreak(tb As MarkdownKit.MKThematicBreak) As Variant

The renderer is visiting a thematic break.

Part of the MarkdownKit.MKRenderer interface.