A facilities notice changed its collection location from “north desk” to “courtyard desk.” A later revision accidentally removed the contact paragraph. The reviewer needs to compare saved versions and recover the missing information without silently publishing an older location. A browser's local draft and a session Undo stack cannot answer which saved notice was approved yesterday.
Supply actual saved revisions
Each saved revision needs a unique revisionId and a UTC date-time string in createdAt. Include its HTML content when loading the list, or implement the separate content callback for lighter list records. TinyMCE does not sort the supplied results; the documentation recommends reverse chronological order.
For an existing classic editor with the plugin available, this integration fragment assumes your application already provides loadNoticeRevisions:
const noticeId = 'notice-42';
const revisionOptions = {
plugins: 'revisionhistory',
toolbar: 'revisionhistory',
revisionhistory_fetch: async () => {
const revisions = await loadNoticeRevisions(noticeId);
return [...revisions].sort((a, b) =>
Date.parse(b.createdAt) - Date.parse(a.createdAt)
);
}
};
Merge these options into the current initialization while keeping the application's other plugins, license, and toolbar controls. loadNoticeRevisions is an application function, not a TinyMCE API. It must load records for the authorized document and reject a failed request. An error should not be converted into a successful empty list that tells the reviewer there is no history.
The sorting assumes valid stored timestamps. Validate revision records at your storage boundary, and keep authoritative IDs, dates, and authorship in the server's trusted save process.
Load full content when the list omits it
An application can return lightweight revision records and fetch the selected content separately:
const lazyRevisionOptions = {
revisionhistory_fetch_revision: async (_editor, revision) => {
const loaded = await loadNoticeRevision(
noticeId,
revision.revisionId
);
if (!loaded || typeof loaded.content !== 'string') {
throw new Error('The saved revision could not be loaded.');
}
return loaded;
}
};
Here loadNoticeRevision is another application storage function. An empty string is valid revision content, so the guard distinguishes an empty saved document from missing data. Verify the returned revision belongs to the requested document and ID in the actual service, including its access checks.
TinyMCE calls this option when the selected or comparison revision lacks content. A visible list of dates therefore does not establish that the corresponding documents can be opened. Test a failed detail load as well as a failed list load.
Understand initial, draft, and saved entries
The plugin creates an initial entry from the editor's loaded content and a draft entry from its current content when history opens. Saved entries come from your callbacks. In a document with saved revisions, the initial entry is disregarded on the assumption that the saved list already includes it. Supply that version yourself if it belongs in the historical record.
The comparison shows the selected revision against its immediate predecessor. Its colors distinguish additions, removals, and modified content, including formatting or attributes. Read the actual contact paragraph and collection location; a colored difference is not an approval decision. The documented comparison ignores HTML comments, so a comment-only change will not produce a meaningful visible content comparison.
Save a restoration through the normal document route
“Restore this version” puts the selected saved content into the editor and closes history. The plugin's VersionRestored event identifies a restoration. Decide whether your application creates a new saved revision immediately or waits for its explicit Save action, and make that choice visible to the author.
Keep the previous saved records intact. A restored document can be recorded as a new version with its restoration origin, rather than overwriting the historical version the reviewer selected. revisionhistory_allow_restore: false disables the interface's restoration action for a review-only experience; enforce permissions in the service as well.
The browser draft recovery guide addresses unsaved local text. The editing history guide addresses Undo grouping within an editing model. Neither supplies this application's durable saved-version archive.
For the facilities notice, open the version containing the missing contact paragraph, compare its location wording, and restore only after choosing the intended result. Correct the location if the old version still names the north desk, save the reviewed document, and reopen it through the reader view. Confirm the courtyard instruction and contact information together before handing the notice back to staff.