API / @aionbuilders/nabu/extend

MarkdownHelpers

Type Stability: stable

Definition

TypeScript
import type { MarkdownHelpers } from '@aionbuilders/nabu/extend';
TypeScript
interface MarkdownHelpers {
  interrupts: (lines: string[], index: number) => boolean;
  joinLines: boolean;
  parseBlocks?: (lines: string[], overrides?: { joinLines?: boolean; softBreak?: string }) => PasteBlock[];
  parseInline: (text: string) => Delta<string>[];
  parseInlineSegments: (text: string) => any[];
  softBreak?: string;
}

Properties

Properties of MarkdownHelpers
PropertyTypeDescription
interrupts(lines: string[], index: number) => boolean

Whether the line at index starts a block that ends the paragraph above it

joinLinesboolean

CommonMark semantics: consecutive lines join into one paragraph (importMarkdown); false on paste

parseBlocksoptional(lines: string[], overrides?: { joinLines?: boolean; softBreak?: string }) => PasteBlock[]

Parse lines as a document of their own (the body of a quote...)

parseInline(text: string) => Delta<string>[]

Inline markdown to a Loro delta

parseInlineSegments(text: string) => any[]

Inline markdown to segments (text, images...)

softBreakoptionalstring

What replaces a soft line break in a nested parse

Source: src/lib/utils/extensions.js:74