-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better preserve content on paste #135
Comments
Merging this with #138. |
I find that draftail doesn't preserves any kind of table on paste. Is there any workaround for this? |
@tutuca no, tables aren’t supported by the editor. |
@thibaudcolas I can't find an open issue here but there seems to be some prior art around draft.js proper [1] [2]. It seems hard to believe that there's nobody with the need to paste some tables here and there. Is it too much a hassle to support some pasted tabulated content? [1] draft-js-plugins/draft-js-plugins#921 |
I know people who have wished for table support in the past. I think the main reason why this hasn't happened is that it's not that easy to build in rich text, so most people will just give up on the idea of being able to have tables anywhere in their content. They'll instead choose to make something more purpose-built, custom, and less likely to be open-sourced. For example some integration of https://handsontable.com/. For Draft.js (and Draftail) in particular, I know it's possible but not easy because Draft.js doesn't have good support for nested editing (eg. using Draft.js features within the cells of the tables, having text formatting inside table). I think folks who were frustrated with this tended to switch to Slate, but I didn't follow up. It's still definitely possible though even if not easy – all it takes is for someone to dedicate time to it. https://github.com/SamyPesse/draft-js-table would probably be a good place to start, after having assessed the caveat in its README header about needing facebookarchive/draft-js#388. Without any kind of nested editing, I believe that a custom block using https://handsontable.com/ or similar would be much easier to implement. But that has its own limitations of course. |
What's your opinions on the posibility of a slate port?. Thanks for the deailed response!. |
I considered Slate about 1.5 years ago, but wasn't convinced. The main reason why I didn't pursue it further is that it doesn't have the backing of a big engineering organisation like Facebook's. Technically, Slate seems much more flexible than Draft.js, but in ways that mostly didn't matter to me at the time (wanting to build something for Wagtail specifically). If you or anyone else wants to invest time in building a competing editor, I think it's worth exploring, and I'll be happy to help with my rich text knowledge, but it's a big investment. I'd be much more interested in porting Draftail to the |
See https://github.com/thibaudcolas/draftjs-filters/blob/master/pasting/README.md first.
The text was updated successfully, but these errors were encountered: