draft-js-utils
draft-js-utils copied to clipboard
[export html] Logic to avoid nesting?
Hello all, how are you?
This library works great except for one thing I'm trying to achieve and I don't find how to. Here's my example:
If I have the exact same text both with bold and italic, I want the wrapper span has the two classes. This is a dummy text. With the previous text, I want the result
This is <span class="-bold -italic>a dummy</span> text.
But instead I'm receiving
This is <span class="-bold><span class="-italic"> a dummy</span></span> text.
Here's my current options object
const options = {
inlineStyles: {
BOLD: { element: 'span', attributes: { className: '-bold' } },
ITALIC: { element: 'span', attributes: { className: '-italic' } },
},
defaultBlockTag: null,
};
I tried playing with the block renderers and such without luck.
Please let me know if you need more information here.