Skip to content

Conversation

@js-seo
Copy link

@js-seo js-seo commented Apr 4, 2018

When you do this,

stateFromHTML(htmlContent, {
  customInlineFn: (element, { Style, Entity }) => {
    const { color, fontSize } = element.style
    return Style(`color${color} fontSize${fontSize} FOO BAR`)
  },
})

now each inline element has overlapping four styles.

@RTeran
Copy link

RTeran commented Apr 23, 2018

+1

@VictorParraCant
Copy link

@sstur Why has not this solution been implemented yet? I would like to be able to use it without changing my node_modules. Review please

@ururekina
Copy link

@VictorParraCant @sstur +1

Copy link

@preetriti preetriti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another way to do this with lesser changes.
In line: 344 just use style.union(customInline.styles)

Now the Style in inlineCreators should be changed from string -> string[].
This way it removes the condition that styles should be separated with ' '. The code can be agnostic to that.

@khalska
Copy link

khalska commented Jul 16, 2018

It doesn't work with rgb colours because split find spaces in colours - rgb(255, 120, 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants