Skip to content

Commit

Permalink
fix image link deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaroldi committed Sep 18, 2023
1 parent 8f99244 commit e214063
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ export function deleteSegment(

switch (segmentToDelete.segmentType) {
case 'Br':
case 'Image':
case 'SelectionMarker':
segments.splice(index, 1);
return true;

case 'Image':
if (segmentToDelete.link) {
segments.splice(index, 2);
} else {
segments.splice(index, 1);
}
return true;
case 'Entity':
const operation = segmentToDelete.isSelected
? EntityOperation.Overwrite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export default class ImageEdit implements EditorPlugin {
});

this.shadowSpan.style.verticalAlign = 'bottom';
this.shadowSpan.style.fontSize = '24px';
wrapper.style.fontSize = '24px';

shadowRoot.appendChild(wrapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('ImageEdit | rotate and flip', () => {
editor.select(image);
plugin.setEditingImage(image, ImageEditOperation.Resize);
expect(editor.getContent()).toBe(
'<span style="vertical-align: bottom; font-size: 24px;"><img id="IMAGE_ID_EDITING" src="test"></span>'
'<span style="vertical-align: bottom;"><img id="IMAGE_ID_EDITING" src="test"></span>'
);
});
});
Expand Down

0 comments on commit e214063

Please sign in to comment.