Hacker News new | ask | show | jobs
by icemelt8 1785 days ago
I think the only other team who has made such a feature is Wordpress contributors, Wordpress offers a way to copy paste word documents in their Text box, and it formats correctly.

Perhaps you can launch commercial license for your library, and license it to famous CMSs, such as Umbraco or Craft. That way you can make a living on it too.

2 comments

A few years ago that would have been true, at least client-side. There have been a variety of server-side options for years, especially if you run Windows as the server OS. More recently editors like CKEditor have vastly improved their Word pasting.

Even so, mammoth.js seems to remain unique in the ability to upload a file in the browser and programmatically retrieve matching HTML. That is why I use it - I can get the HTML, process it, and POST it back to my server already cleaned up and ready for my CMS. The browser does all the heavy lifting, my server remains a basic CRUD app, and I don't have to allow file uploads as it all happens client-side.

They mention docx so I guess it takes the file as input (as opposed to clipboard contents for web JS editors).