draft-js-utils icon indicating copy to clipboard operation
draft-js-utils copied to clipboard

[export html] Logic to avoid nesting?

Open Lzok opened this issue 5 years ago • 0 comments

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.

Related issue with no solution

Lzok avatar Dec 07 '19 14:12 Lzok