Hufe921 / canvas-editor-plugin

plugins for canvas-editor
https://hufe.club/canvas-editor-plugin
MIT License
63 stars 22 forks source link

Docx | Docx Import Via Mamoth.js #20

Open jordanparker6 opened 2 weeks ago

jordanparker6 commented 2 weeks ago

Importing via mamoth.js is going to always have issues as many of the docx styles and blocks are not supported.

See https://github.com/mwilliamson/mammoth.js/

Unfortunately, something more complex is going to be required for this feature to work for production use cases.

Happy to lend a hand if anyone wants to team up on this as having the import feature support the full set of default blocks and marks of thecanvas-editor would be amazing.

jordanparker6 commented 2 weeks ago

For the export, going to pandoc JSON as an intermediately could be a good approach to export to multiple formats

https://discuss.prosemirror.net/t/pandoc-export/6452/2

jordanparker6 commented 2 weeks ago

https://github.com/lalalic/docx4js

https://github.com/zhangyu836/docxjs

This could be better

Boxser567 commented 1 week ago

@jordanparker6
I have used Mammoth.js, but it failed because the DOCX content contains a lot of unusual formatting, which is hard to control. maybe you can provide a plugin of DOCX.