# Editing Toolkit with scripts and external versions

Use the Editing Toolkit to review changes produced by a script, a content-processing job, or an updated Word file. It compares the revised HTML with a snapshot of the document and presents the differences for users to review in CKEditor 5.

> **Unlock this feature with the Custom Plan**
>
> Try this feature for **free during your trial** — no credit card required.\
> After the trial, it’s available as a premium add-on in the [CKEditor Custom Plan](https://ckeditor.com/pricing/).
>
> [Sign up for a free trial ](https://portal.ckeditor.com/checkout?plan=free)[Contact sales](https://ckeditor.com/contact-sales/)

<a id="demo"></a>

## Demo

The demo offers two actions without an LLM:

* **Update terminology** – A browser script renames the help desk and onboarding buddy in the document text.
* **Compare with Word file** – The demo loads a prepared Word version, converts it through the Import from Word REST API, and compares the HTML with the current document.

Review the differences in the panel, then apply them directly or as Track Changes suggestions. Reset the demo to try the other action.

View the script and Word file

Terminology script Replaces two known phrases in this demo's HTML. Element IDs remain unchanged.

| Replace          | With              |
| ---------------- | ----------------- |
| IT helpdesk      | Service Desk      |
| onboarding buddy | onboarding mentor |

```js
const snapshot = documentCompare.makeSnapshot();
const processed = snapshot.content.main
	.replaceAll( 'IT helpdesk', 'Service Desk' )
	.replaceAll( 'onboarding buddy', 'onboarding mentor' );
const changes = documentCompare.computeChanges( snapshot, processed );
```

Word file An updated copy of the document without tracked edits. The demo converts it to HTML, then takes a snapshot of the current editor content without element IDs and compares the two versions by content similarity.

* Typos fixed in the introduction and the first section.
* "IT helpdesk" renamed to "Service Desk".
* "Your first three days" retitled to "Your first week", with a Day 4 item added.

[Download the example Word file](https://ckeditor.com/docs/ckeditor5/latest/assets/docx/onboarding-guide-updated.docx)

<!-- AI-AGENT-NOTE: An interactive demo is embedded here but is not represented in this Markdown file. If you need to see it in action, open this page in a browser (e.g. via a browser-automation MCP like Chrome DevTools or Playwright), or let the user know a live demo is available on this page. -->

This demo presents a limited set of features. Visit the [feature-rich editor example](../../../examples/builds-custom/full-featured-editor.md) to see more in action.

<a id="when-to-use-this-approach"></a>

## When to use this approach

* Run find-and-replace operations, terminology changes, product renames, or other standardized content processing in a browser script or backend job, then let users review the results.
* Compare an external version with the current document, even if the author did not track their edits. The version can be an updated Word copy converted with the [Import from Word REST API](../../converters/import-word/import-word.md#rest-api) or content from another source converted to HTML.
* Regenerate content from a data source and let the people working on the document review the resulting edits.

<a id="how-it-works"></a>

## How it works

The diagram shows the script workflow:

![Script workflow: capture a snapshot, transform its HTML, compare the result, and review the changes in the editor.](https://ckeditor.com/docs/ckeditor5/latest/assets/img/editing-toolkit-deterministic-scripts.svg)

1. The user picks an action in your application, or your code schedules one.
2. Your application takes a snapshot through the Editing Toolkit. Keep the element IDs when transforming its HTML so the comparison can match elements across versions.
3. Your script receives the snapshot content.
4. The script returns revised HTML.
5. The toolkit compares the result with the original snapshot and groups the differences into reviewable changes.
6. Your application applies the changes directly, records them as Track Changes suggestions, or presents them for review as in the demo.
7. The user applies or rejects each proposed change.

For a Word file or another external version, convert it to HTML first, then take a fresh snapshot with `makeSnapshot( { useDataIds: false } )` immediately before comparison. Without element IDs, Compare matches elements by content similarity. Conversion can introduce formatting differences, so review the result in the editor configuration your application uses.

If the Word file already contains tracked changes, use [Import from Word](../../converters/import-word/import-word.md) with Track Changes enabled instead. It imports them as suggestions with the authors’ names.

<a id="what-you-need"></a>

## What you need

* The `DocumentCompare` plugin with a license key, plus `ProposedChanges` for the Proposed changes UI. See the [Comparing documents](../compare/editing-toolkit-comparing-documents.md) and [Proposing changes](../compare/editing-toolkit-proposing-changes.md) guides for setup.
* For Word files, access to the [Import from Word](../../converters/import-word/import-word.md) converter and a token authorized to use it.
* The [Track Changes integration](../../collaboration/track-changes/track-changes-integration.md) if changes should be recorded as suggestions.

---

Full index of the CKEditor 5 documentation: [llms.txt](../../../../llms.txt)
