codex-team/editor.js

Paste Config Improvement: add support for a filter function in pasteConfig to allow matching elements by attributes

Open

#2.959 aberto em 14 de out. de 2025

Ver no GitHub
 (17 comments) (2 reactions) (0 assignees)TypeScript (1.985 forks)batch import
good first issue

Métricas do repositório

Stars
 (26.602 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Motivation

  • Need a central place to validate/normalize app-generated paste payloads.

  • Current gaps:

    • Multiline paste: patterns aren’t applied because payload is treated as HTML.
    • Can’t apply cross-line rules (e.g., “entire bold line → header”) before blocks are created.
    • Special formatting cases are hard to solve tool-by-tool (see #2909).

Proposal

  • Add a top-level pasteInterceptor option that receives PasteData(s) and can transform/validate them before insertion.

Prior art / PoC

Next steps

  • If this sounds reasonable, I can open a PR with the solution.

Guia do colaborador