Skip to content

Commit

Permalink
Merge branch 'master' into u/jisong/2927
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong authored Feb 12, 2025
2 parents 93874f6 + bbe7d52 commit e9e2084
Show file tree
Hide file tree
Showing 4 changed files with 19 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 @@ -8,6 +8,7 @@ const ContentHandlers: {
['text/plain']: (data, value) => (data.text = value),
['text/*']: (data, value, type?) => !!type && (data.customValues[type] = value),
['text/link-preview']: tryParseLinkPreview,
['text/uri-list']: (data, value) => (data.text = value),
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,20 @@ describe('extractClipboardItems', () => {
pasteNativeEvent: true,
});
});

it('input with text/uri-list', async () => {
const text = 'https://example.com';
const clipboardData = await extractClipboardItems([
createStringItem('text/uri-list', text),
]);
expect(clipboardData).toEqual({
types: ['text/uri-list'],
text: text,
image: null,
files: [],
rawHtml: null,
customValues: {},
pasteNativeEvent: true,
});
});
});

0 comments on commit e9e2084

Please sign in to comment.