Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion meta/bundle-size-stats/Draft.js.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion meta/bundle-size-stats/Draft.min.js.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3074,6 +3074,8 @@ exports[`img with data protocol should be correctly parsed 1`] = `"\\ud83d\\udcf

exports[`img with http protocol should have camera emoji content 1`] = `"\\ud83d\\udcf7"`;

exports[`img with https protocol should have camera emoji content 1`] = `"\\ud83d\\udcf7"`;

exports[`img with role presentation should not be rendered 1`] = `Array []`;

exports[`line break should be correctly parsed - multiple <br> in a content block 1`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ test('img with http protocol should have camera emoji content', () => {
'<img src="http://www.facebook.com">',
);
expect(blocks.contentBlocks[0].text).toMatchSnapshot();
expect(
blocks.entityMap.__get(blocks.entityMap.__getLastCreatedEntityKey())
.mutability,
).toBe('IMMUTABLE');
});

test('img with https protocol should have camera emoji content', () => {
const blocks = convertFromHTMLToContentBlocks(
'<img src="https://www.facebook.com">',
);
expect(blocks.contentBlocks[0].text).toMatchSnapshot();
expect(
blocks.entityMap.__get(blocks.entityMap.__getLastCreatedEntityKey())
.mutability,
).toBe('IMMUTABLE');
});

test('img with data protocol should be correctly parsed', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/model/encoding/convertFromHTMLToContentBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ class ContentBlocksBuilder {
// TODO: T15530363 update this when we remove DraftEntity entirely
this.currentEntity = this.entityMap.__create(
'IMAGE',
'MUTABLE',
'IMMUTABLE',
entityConfig,
);

Expand Down