Skip to content
Open
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
7 changes: 5 additions & 2 deletions packages/draft-js-import-element/src/stateFromElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class ContentGenerator {
if (customInline != null) {
switch (customInline.type) {
case 'STYLE': {
style = style.add(customInline.style);
style = style.union(customInline.style.split(' '));
break;
}
case 'ENTITY': {
Expand Down Expand Up @@ -385,9 +385,12 @@ class ContentGenerator {
let style = block.styleStack.slice(-1)[0];
let entity = block.entityStack.slice(-1)[0];
let charMetadata = CharacterMetadata.create({
style: style,
entity: entity,
});
style.forEach((s) => {
charMetadata = CharacterMetadata.applyStyle(charMetadata, s);
return true;
});
let seq: CharacterMetaSeq = Repeat(charMetadata, text.length);
block.textFragments.push({
text: text,
Expand Down