Link extension for tiptap rich text editor providing automatic link detection, paste handling, click behavior, and XSS protection.
88
Build a rich text editor component that can import HTML content with links, preserve link attributes, and export clean HTML with properly formatted anchor tags.
Create a simple rich text editor using a text editing framework that can handle HTML input/output with anchor tags. The editor should parse HTML containing links with various attributes (href, target, rel, class) and render them back to properly formatted HTML.
<a>) tags as inputhref, target, rel, and class attributes from links<a> tags<a href="https://example.com">Link</a> preserves the href attribute @test<a href="/docs" target="_blank" rel="noopener" class="external">Docs</a> preserves all attributes @test@generates
interface EditorOptions {
content?: string;
}
/**
* Creates a rich text editor instance with link support
* @param options - Configuration options including initial content
* @returns Editor instance
*/
export function createEditor(options?: EditorOptions): Editor;
interface Editor {
/**
* Sets HTML content in the editor, parsing any link elements
* @param html - HTML string to import
*/
setContent(html: string): void;
/**
* Exports editor content as HTML with properly formatted links
* @returns HTML string representation
*/
getHTML(): string;
}Provides link functionality for rich text editors including HTML parsing and rendering capabilities.
Install with Tessl CLI
npx tessl i tessl/npm-tiptap--extension-linkdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10