Skip to content

Commit

Permalink
Merge branch 'master' into u/jisong/skipunstabletest
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanValverdeU authored Feb 18, 2025
2 parents e84ab9c + ce1afbe commit 3d25790
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';
import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';
import type { IEditor } from 'roosterjs-content-model-types';

Expand All @@ -20,7 +19,6 @@ export function toggleUnderline(editor: IEditor) {
}
},
(format, segment) => !!format.underline || !!segment?.link?.format?.underline,
false /*includingFormatHolder*/,
adjustTrailingSpaceSelection
false /*includingFormatHolder*/
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,12 @@ describe('toggleUnderline', () => {
segments: [
{
segmentType: 'Text',
text: 'Test',
text: 'Test ',
format: {
underline: true,
},
isSelected: true,
},
{
segmentType: 'Text',
text: ' ',
format: {},
isSelected: true,
},
],
format: {},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ class RibbonPluginImpl implements RibbonPlugin {
private updateFormat() {
if (this.editor && this.onFormatChanged) {
const newFormatState = getFormatState(this.editor);
const newFormatKeys = getObjectKeys(newFormatState);

if (
!this.formatState ||
newFormatKeys.length != getObjectKeys(this.formatState).length ||
getObjectKeys(newFormatState).some(
key => newFormatState[key] != this.formatState?.[key]
)
Expand Down

0 comments on commit 3d25790

Please sign in to comment.