UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

20 lines (19 loc) 833 B
import type { DocNode } from '@atlaskit/adf-schema'; export declare const getNestingRulesFromSchema: () => Record<string, string[]>; /** * Simple SSR-compatible parser that recognises text wrapped in HTML elements * and extracts their content as ADF. * * Designed specifically for parsing i18n strings for ADF which specifically need to be * HTML strings for translation. * * Supports nested structures automatically derived from the ADF schema: * - Lists: ul/ol → li (listItem) * - Tables: table → tr (tableRow) → td/th (tableCell/tableHeader) * - Paragraphs, code blocks, and text marks * - Any other nested structures defined in the schema * * @param html - The HTML string to parse * @returns ADF DocNode containing the parsed content */ export declare const parseHTMLTextContent: (html: string) => DocNode;