From zbeyens. The source code is available on GitHub.

Plate
PlatePliteEditorsTemplates
GitHub16kGitHub
DiscordDiscord
UNPUBLISHED
  • Overview
  • Why This Fork
  • Examples
Walkthroughs
  • Installing Plite
  • Adding Event Handlers
  • Defining Custom Elements
  • Applying Custom Formatting
  • Executing Commands
  • Saving to a Database
  • Canonical Change Substrate
  • Improving Performance
Concepts
  • Interfaces
  • Nodes
  • Locations
  • Transforms
  • Document Changes
  • Commands
  • Editor
  • Extensions
  • Rendering
  • Serializing
  • Normalizing
  • Using TypeScript
  • Roots
  • Document State
  • Editing Behavior
  • Selection And DOM
  • Clipboard And Paste
  • Projection And Overlays
  • Schema
API
  • Anchor API
  • Location API
  • Path API
  • PointEntry API
  • Point API
  • Range API
  • Selection API
  • Location Types APIs
  • Span API
  • Editor
  • Element API
  • NodeEntry API
  • Node API
  • Node Types APIs
  • Text API
  • Debug Value Scrubbing
  • Transforms API
Libraries
  • Plite DOM
  • History Editor API
  • History Extension Setup
  • History
  • Plite History
  • Plite Hyperscript
  • Plite Layout
  • Annotations
  • DOM Coverage Boundaries
  • Editable Component
  • Plite React Event Handling
  • Virtualized Rendering
  • Plite React Hooks
  • React Editor Setup
  • React Editor
  • Plite React
  • Plite Component
  • Plite Yjs
  • Plite
General
  • Migration
  • Contributing
  • Docs Proof Map
  • FAQ
  • Resources

Debug Value Scrubbing

PreviousNext

Debug scrubber API for redacting values in thrown Plite errors.

Plite formats some thrown error details with document values and nodes. Text fields are redacted by default. Apps that need stricter diagnostics can install a scrubber for additional fields.

Install A Scrubber

import { setDebugValueScrubber } from "@platejs/plite";
 
setDebugValueScrubber((key, value) => {
  if (key === "text" || key === "src") return "[redacted]";
  return value;
});
import { setDebugValueScrubber } from "@platejs/plite";
 
setDebugValueScrubber((key, value) => {
  if (key === "text" || key === "src") return "[redacted]";
  return value;
});

Pass null or undefined to restore the default scrubber.

setDebugValueScrubber(null);
setDebugValueScrubber(null);

API

setDebugValueScrubberconst@platejs/plite
setDebugValueScrubber: (scrubber: DebugValueScrubber | null | undefined) => void

Override the debug value scrubber used by Plite diagnostic formatting.

Source

Set the function used before Plite formats debug values.

DebugValueScrubbertype@platejs/plite
type DebugValueScrubber = (key: string, value: unknown) => unknown;

Hook for replacing values before Plite debug output is stringified.

Source

The custom scrubber runs before Plite's default text redaction. Return the original value to let the default scrubber handle it.

Text APITransforms API

On This Page

Install A ScrubberAPI
Build your editor
Production-ready AI template and reusable components.
Get all-access