MarkdownExtension

class MarkdownExtension(val editorState: TextEditorState, initialConfiguration: MarkdownConfiguration = MarkdownConfiguration.DEFAULT, var imageProvider: ImageProvider? = null)(source)

An extension to TextEditorState that provides markdown functionality. This separates markdown concerns from the core text editor functionality.

Constructors

Link copied to clipboard
constructor(editorState: TextEditorState, initialConfiguration: MarkdownConfiguration = MarkdownConfiguration.DEFAULT, imageProvider: ImageProvider? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun importMarkdown(markdownText: String)
Link copied to clipboard

Returns whether line is currently rendered as a blockquote.

Link copied to clipboard

Returns whether line is currently rendered as a bullet-list item.

Link copied to clipboard
fun isCodeFence(line: Int): Boolean

Returns whether line is currently rendered as a fenced code line.

Link copied to clipboard

Returns whether line is currently rendered as an ordered-list item.

Link copied to clipboard

Adds blockquote rendering (left bar + indented text) to each line in lines that doesn't already have it; removes it from lines that do. Mixed selections enable on every line for predictable toolbar behavior.

Link copied to clipboard

Adds bullet-list rendering (gutter dot + hanging indent) to each line in lines that doesn't already have it; removes it from lines that do. Mixed selections enable on every line for predictable toolbar behavior.

Link copied to clipboard

Adds fenced-code rendering (monospace text + tinted card with a hairline border) to each line in lines that doesn't already have it; removes it from lines that do. Mixed selections enable on every line for predictable toolbar behavior. Code fences demote any blockquote/list on the same line — the four block styles can't coexist visually.

Link copied to clipboard

Adds ordered-list rendering (gutter numeral + hanging indent) to each line in lines that doesn't already have it; removes it from lines that do. Mixed selections enable on every line for predictable toolbar behavior. Numbering is recomputed automatically based on contiguous-run position.