Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export function handleTabOnParagraph(
if (markerIndex <= 0) {
return false;
}

const tabText = paragraph.segments[markerIndex - 1];
const tabSpacesLength = tabSpaces.length;

Expand All @@ -117,6 +118,8 @@ export function handleTabOnParagraph(
} else {
return false;
}
} else {
return false;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,49 @@ describe('handleTabOnParagraph', () => {
runTest(model, paragraph, rawEvent, true);
});

it('Outdent - collapsed range should return false when only entities exist before the marker', () => {
const model: ContentModelDocument = {
blockGroupType: 'Document',
blocks: [
{
blockType: 'Paragraph',
segments: [
{
blockType: 'Entity',
segmentType: 'Entity',
format: {},
entityFormat: {
id: 'entity-1',
entityType: 'test',
isReadonly: true,
},
wrapper: document.createElement('span'),
},
{
segmentType: 'SelectionMarker',
isSelected: true,
format: {},
},
{
segmentType: 'Text',
text: 'test',
format: {},
},
],
format: {},
},
],
format: {},
};
const paragraph = model.blocks[0] as ContentModelParagraph;
const rawEvent = new KeyboardEvent('keydown', {
key: 'Tab',
shiftKey: true,
});

runTest(model, paragraph, rawEvent, false);
});

it('Indent - expanded range should return true', () => {
const model: ContentModelDocument = {
blockGroupType: 'Document',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
pptClipboardContent3,
pptClipboardContent4,
} from './htmlTemplates/powerPointClipboardContent';
import { itChromeOnly } from 'roosterjs-content-model-dom/test/testUtils';

describe('PowerPoint', () => {
let editor: IEditor = undefined!;
Expand All @@ -34,7 +33,10 @@ describe('PowerPoint', () => {
document.getElementById('PowerPoint')?.remove();
});

itChromeOnly('PowerPoint 1', () => {
it('PowerPoint 1', () => {
const fontStyle = document.createElement('span').style;
fontStyle.fontFamily = 'Courier New';

paste(editor!, pptClipboardContent1, 'normal');

expect(setProcessorF.setProcessor).toHaveBeenCalledTimes(2);
Expand Down Expand Up @@ -107,7 +109,7 @@ describe('PowerPoint', () => {
isSelected: false,
segmentType: 'SelectionMarker',
format: {
fontFamily: '"Courier New"',
fontFamily: fontStyle.fontFamily,
fontSize: '7pt',
textColor: 'rgb(0, 0, 0)',
},
Expand Down
Loading