element-tiptap icon indicating copy to clipboard operation
element-tiptap copied to clipboard

Copy and paste formatting issues

Open SinLiz opened this issue 3 years ago • 13 comments

Are there any plans to provide content parsing functions for copying content from "word" or web pages? Now copying from "word" documents, the formatting is problematic.

SinLiz avatar Aug 04 '20 03:08 SinLiz

Could you tell me more details about paste content problem ? You can customize the behavior of paste by handlePaste, check https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste

Leecason avatar Aug 04 '20 07:08 Leecason

Could you tell me more details about paste content problem ? You can customize the behavior of paste by handlePaste, check https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste

Copy and paste the content from .doc docx and report an error: image But I see your example is no problem, at most the format is removed, but I directly report an error

SinLiz avatar Aug 04 '20 09:08 SinLiz

Could you tell me more details about paste content problem ? You can customize the behavior of paste by handlePaste, check https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste

Copy and paste the content from .doc docx and report an error: image But I see your example is no problem, at most the format is removed, but I directly report an error

Uncaught RangeError: No value supplied for attribute px.

SinLiz avatar Aug 04 '20 09:08 SinLiz

Can you give me a copy of the text you copied ?

Leecason avatar Aug 17 '20 04:08 Leecason

@Leecason 我也遇到同样的问题。 我fork了你的项目,修改了Add Link和Edit Link的一小点功能,build:lib的时候报了个错,但是照样生成了lib,照样是可以用的。但是,当编辑内容的时候,从别的网页上拷贝一段文本,比如是github上的readme,粘贴的时候就会有这个报错。

感觉是依赖包的版本更新所造成的问题。:coffee:

WaldenLiang avatar Oct 23 '20 14:10 WaldenLiang

I have same issue. But not only text from Word some html copied text causes same Error.

servetoz avatar Oct 25 '20 12:10 servetoz

I found out that fontsize extension causes this error. When I disable it, It is working w/o any problem. You can reproduce the error from here: https://codesandbox.io/s/template-button-forked-dm2le?file=/src/components/Editor.vue For text you can just open a word document and write something then set font size of it. And copy and paste into editor wont working.

servetoz avatar Oct 25 '20 13:10 servetoz

Same problem here, FontSize extension causes the impossibility to paste in an H2 heading copied from gitlab for exemple. Can you fix this please ? Between, nice implementation of tiptap !

zk118 avatar Nov 26 '20 15:11 zk118

Any workaround for this ? (except disabling the FontSize extension)

zk118 avatar Jan 14 '21 08:01 zk118

Any workaround for this ? (except disabling the FontSize extension)

image

This is my best practice after exploring. For me, I don't need FontSize, the H tag can completely replace it. So it depends on your needs.

SinLiz avatar Jan 14 '21 08:01 SinLiz

Any workaround for this ? (except disabling the FontSize extension)

image

This is my best practice after exploring. For me, I don't need FontSize, the H tag can completely replace it. So it depends on your needs.

I need FontSize :confused:

zk118 avatar Jan 14 '21 09:01 zk118

Any workaround for this ? (except disabling the FontSize extension)

image This is my best practice after exploring. For me, I don't need FontSize, the H tag can completely replace it. So it depends on your needs.

I need FontSize 😕

emmm.. Then you need to study it yourself, I wish you success, you can share it afterwards

SinLiz avatar Jan 14 '21 09:01 SinLiz

We need an option to copy and paste from word and when I'm doing this it will not be copied exactly the same. For example the tables are not going to get copied, and they will get removed or images and ....

Is there any extension or plan on adding support to copying and pasting from word??

samyarkd avatar Dec 15 '22 14:12 samyarkd