remarkjs / remark-react

Legacy plugin to transform to React — please use `remark-rehype` and `rehype-react` instead
https://unifiedjs.com
MIT License
524 stars 37 forks source link

Use hast-util-table-cell-style to adjust align properties #51

Closed davidtheclark closed 6 years ago

davidtheclark commented 6 years ago

Allows removal of the readme warning that users might need to perform this step themselves if they use custom components. The transformation of align to a style will happen before their custom component is invoked.

@wooorm: I needed to do this same thing in another package I'm working on, so I tried creating a more reusable way to accomplish the same thing with https://github.com/mapbox/hast-util-table-cell-style. Before I merge this, I'd love a quick look to see if you think this is the right approach.

davidtheclark commented 6 years ago

I think this is a major release, right?

I guess we could be conservative and do that. The only use case I know of that might break is if somebody has a custom table cell component that deliberately removes align properties instead of translating them to a style — and after this change the text-align equivalent might sneak through.

I'll plan to merge and release sometime this week.

wooorm commented 6 years ago

Oh maybe you’re right. I trust your judgement! And sounds good!