Skip to content

Commit

Permalink
chore: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 committed Nov 14, 2024
1 parent cd03717 commit e66646c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content/collaboration/documents/snapshot-compare.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ const editor = new Editor({

#### Using `mapDiffToDecorations` for diff decorations

The extension has a default mapping (`defaultMapToDecorations`) to represent diffs as ProseMirror decorations.
The extension has a default mapping (`defaultMapDiffToDecorations`) to represent diffs as ProseMirror decorations.
For more complex integrations and control, you can customize this mapping with the `mapDiffToDecorations` option.

**Example:** Applying custom predefined background colors to inline inserts

```ts
SnapshotCompare.configure({
mapDiffToDecorations: ({ diff, tr, editor, defaultMapToDecorations }) => {
mapDiffToDecorations: ({ diff, tr, editor, defaultMapDiffToDecorations }) => {
if (diff.type === 'inline-insert') {
// return prosemirror decoration(s) or null
return Decoration.inline(
Expand All @@ -91,7 +91,7 @@ SnapshotCompare.configure({
}

// fallback to the default mapping
return defaultMapToDecorations({
return defaultMapDiffToDecorations({
diff,
tr,
editor,
Expand Down

0 comments on commit e66646c

Please sign in to comment.