4 ms·
Were you able to handle paste-from-word? If so, would you mind sharing that bit of code on github? I would love to make a custom solution, but 90% of the conten
by degenerate 11y ago
Were you able to handle paste-from-word? If so, would you mind sharing that bit of code on github? I would love to make a custom solution, but 90% of the content being put into our CMS is copied from Word. To clean it effectively, I resort to using CKEditor to clean it for me and then storing as HTML. I'd love to not do that, but CKEditor seems to have figured out all the problems, especially when pasting tables or adjacently aligned content.
My users won't learn markdown and expect it to just "work". For complex Word documents, I never came up with a viable solution to parse it.
- morgante 11y agoYes, we were able to handle pasting from Word. We basically gathered a ton of examples of the HTML which Word generates and then developed mappings from that HTML to the actions we supported. TDD and unit testing made it fairly efficient. Keep in mind that we purposefully did not support the full scope of HTML which Word would output. Authors couldn't make their headlines 50pt Comic Sans in red, for example. I'd love to share the code, but unfortunately it's from an old employer and I no longer have access (or the right to share the code).