codex-team/editor.js

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

Open

#2959 aperta il 14 ott 2025

Vedi su GitHub
 (17 commenti) (2 reazioni) (0 assegnatari)TypeScript (1985 fork)batch import
good first issue

Metriche repository

Star
 (26.602 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor