Headless rich text editor built on ProseMirror with extensible architecture for building custom editors
94
Build a utility that reads and exports rich text editor content in multiple formats (HTML, JSON, and plain text).
The utility should provide a function that takes editor content and exports it to HTML, JSON, and plain text formats simultaneously.
<p>Hello World</p>, JSON containing the document structure, and text containing "Hello World" @testThe utility should support custom options for extracting plain text, including custom block separators.
@generates
/**
* Options for exporting editor content
*/
export interface ExportOptions {
/** Custom block separator for text output (default: "\n\n") */
blockSeparator?: string;
}
/**
* Result of exporting editor content in multiple formats
*/
export interface ExportResult {
/** HTML string representation of the content */
html: string;
/** JSON representation of the document structure */
json: any;
/** Plain text representation of the content */
text: string;
}
/**
* Exports editor content to multiple formats simultaneously
*
* @param editor - The Tiptap Editor instance
* @param options - Optional configuration for text serialization
* @returns An object containing HTML, JSON, and text representations
*/
export function exportContent(editor: any, options?: ExportOptions): ExportResult;Provides rich text editor functionality with content export capabilities.
@satisfied-by
Provides basic editor extensions for testing purposes.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-tiptap--coredocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10