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?
|
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:

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
I need line something like this:
Here are the correct styles: