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

Format Inspector

A utility that inspects the current formatting state of a Tiptap editor and returns detailed information about active marks and nodes at the current selection.

Capabilities

Active mark detection

  • Returns true when checking if bold mark is active at a position with bold text @test
  • Returns false when checking if bold mark is active at a position without bold text @test
  • Returns true when checking if link mark is active at a position within a link @test

Active node detection

  • Returns true when checking if heading node is active at a position in a heading @test
  • Returns false when checking if heading node is active at a position in a paragraph @test
  • Returns true when checking if bulletList node is active when cursor is in a bullet list @test

Attribute retrieval

  • Returns the correct level attribute (e.g., {level: 2}) when getting attributes of a heading node @test
  • Returns the href attribute (e.g., {href: "https://example.com"}) when getting attributes of a link mark @test
  • Returns an empty object when getting attributes of a node/mark that has no attributes @test

Implementation

@generates

API

import { Editor } from '@tiptap/core';

/**
 * Checks if a specific mark is active at the current selection
 * @param editor - The Tiptap editor instance
 * @param markName - The name of the mark to check (e.g., 'bold', 'italic', 'link')
 * @returns true if the mark is active, false otherwise
 */
export function isMarkActive(editor: Editor, markName: string): boolean;

/**
 * Checks if a specific node type is active at the current selection
 * @param editor - The Tiptap editor instance
 * @param nodeName - The name of the node to check (e.g., 'heading', 'paragraph', 'bulletList')
 * @returns true if the node is active, false otherwise
 */
export function isNodeActive(editor: Editor, nodeName: string): boolean;

/**
 * Gets the attributes of a specific mark at the current selection
 * @param editor - The Tiptap editor instance
 * @param markName - The name of the mark to get attributes for
 * @returns an object containing the mark's attributes, or empty object if not active
 */
export function getMarkAttributes(editor: Editor, markName: string): Record<string, any>;

/**
 * Gets the attributes of a specific node at the current selection
 * @param editor - The Tiptap editor instance
 * @param nodeName - The name of the node to get attributes for
 * @returns an object containing the node's attributes, or empty object if not active
 */
export function getNodeAttributes(editor: Editor, nodeName: string): Record<string, any>;

Dependencies { .dependencies }

@tiptap/core { .dependency }

Provides the core editor functionality and state inspection APIs

@satisfied-by

@tiptap/starter-kit { .dependency }

Provides common extensions including Bold, Heading, BulletList, and Link marks/nodes for testing

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-tiptap--core

tile.json