CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-tiptap--core

Headless rich text editor built on ProseMirror with extensible architecture for building custom editors

94

1.00x
Overview
Eval results
Files

task.mdevals/scenario-3/

Rich Text Content Exporter

Build a utility that reads and exports rich text editor content in multiple formats (HTML, JSON, and plain text).

Capabilities

Multi-format content export

The utility should provide a function that takes editor content and exports it to HTML, JSON, and plain text formats simultaneously.

  • Given editor content with a paragraph "Hello World", calling the export function returns an object with HTML containing <p>Hello World</p>, JSON containing the document structure, and text containing "Hello World" @test
  • Given editor content with multiple paragraphs separated by block separators, the text export should preserve the separation between paragraphs @test

Custom text serialization

The utility should support custom options for extracting plain text, including custom block separators.

  • Given editor content with two paragraphs "First" and "Second", using a custom block separator "---" results in text output "First---Second" @test

Implementation

@generates

API

/**
 * 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;

Dependencies { .dependencies }

@tiptap/core { .dependency }

Provides rich text editor functionality with content export capabilities.

@satisfied-by

@tiptap/starter-kit { .dependency }

Provides basic editor extensions for testing purposes.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-tiptap--core

tile.json