-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Description
Hi thank you for creating this awesome library!
I am working on fixing an issue on one of my draft-js repos:
betancourtl/draft-js-custom-styles#2
I basically need to use the customStyleFn to return an array of styles to be applied to an element. As of now you can only return 1 style. Would it be possible to make a change that could return an array of styles from the customStyle fn?
draft-js-utils/packages/draft-js-import-element/src/stateFromElement.js
Lines 340 to 352 in c3d6145
| let customInline = customInlineFn ? customInlineFn(element, this.inlineCreators) : null; | |
| if (customInline != null) { | |
| switch (customInline.type) { | |
| case 'STYLE': { | |
| style = style.add(customInline.style); | |
| break; | |
| } | |
| case 'ENTITY': { | |
| entityKey = customInline.entityKey; | |
| break; | |
| } | |
| } | |
| } else { |
I need line something like this:
var customInline = customInlineFn ? customInlineFn(element, this.inlineCreators) : null;
if (customInline != null) {
switch (customInline.type) {
case 'STYLE':
{
// Adds strings or arrays as styles.
[].concat(customInline.style).forEach(x => style = style.add(x));
break;
}Here are the correct styles:
Metadata
Metadata
Assignees
Labels
No labels
