I'm using it in Vue3 + Tiptap
I wrote a code like #4,but get Uncaught (in promise) Error: nodebuffer is not supported by this platform
const exportDocx = async () => {
if (!editor.value) return
const nodeSerializer = {
...defaultNodes,
hardBreak: defaultNodes.hard_break,
codeBlock: defaultNodes.code_block,
orderedList: defaultNodes.ordered_list,
listItem: defaultNodes.list_item,
bulletList: defaultNodes.bullet_list,
horizontalRule: defaultNodes.horizontal_rule,
};
const myDocxSerializer = new DocxSerializer(nodeSerializer, defaultMarks);
const opts = {
getImageBuffer(src: string) {
return new Uint8Array([1, 2, 3]);
},
};
const wordDocument = myDocxSerializer.serialize(editor.value.state.doc, opts);
writeDocx(wordDocument, (buffer) => {
// use buffer
});
}
I'm using it in Vue3 + Tiptap
I wrote a code like #4,but get
Uncaught (in promise) Error: nodebuffer is not supported by this platform