Skip to content

Commit

Permalink
Fix annotation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Dec 4, 2023
1 parent 2fcbafd commit 99600d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/rich-text/src/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,18 @@ export function useRichText( {
if ( disableFormats ) {
_value.current = newRecord.text;
} else {
const newFormas = __unstableBeforeSerialize
const newFormats = __unstableBeforeSerialize
? __unstableBeforeSerialize( newRecord )
: newRecord.formats;
newRecord = { ...newRecord, formats: newFormas };
newRecord = { ...newRecord, formats: newFormats };
if ( typeof value === 'string' ) {
_value.current = toHTMLString( { value: newRecord } );
} else {
_value.current = new RichTextData( newRecord );
}
}

const { start, end, formats, text } = newRecord;
const { start, end, formats, text } = record.current;

// Selection must be updated first, so it is recorded in history when
// the content change happens.
Expand Down

0 comments on commit 99600d3

Please sign in to comment.