Sync & history

sync.enabled#

Type: boolean

Default: true

Turns the live sync pipeline on or off. When enabled, the editor mirrors changes back to the source element (when possible) and emits change-related events.

const app = Redactor('#entry', {
  sync: {
    enabled: false
  }
});

sync.debounce#

Type: number

Default: 300

Debounce time in milliseconds for sync updates. Higher values reduce update frequency (useful for large documents); lower values make external sync feel more “live”.

const app = Redactor('#entry', {
  sync: {
    debounce: 500
  }
});

sync.format#

Type: 'html' | 'json'

Default: 'html'

Controls the sync snapshot format used by the sync pipeline. Use 'html' to mirror HTML strings, or 'json' to mirror serialized JSON.

const app = Redactor('#entry', {
  sync: {
    format: 'json'
  }
});

sync.blockMutationEvents#

Type: boolean

Default: true

When enabled, the editor may emit block-level mutation events (blocks:mutated) derived from DOM changes. This is useful for integrations that react to granular block updates.

const app = Redactor('#entry', {
  sync: {
    blockMutationEvents: false
  }
});

history.limit#

Type: number

Default: 200

Maximum number of undo/redo snapshots the editor keeps. Larger values allow deeper undo history but use more memory.

const app = Redactor('#entry', {
  history: {
    limit: 100
  }
});