chinalwb / Android-Rich-text-Editor

Android Rich Text Editor With customized spans - 富文本编辑器 - Don't miss this one :)
Apache License 2.0
840 stars 169 forks source link

Paste Clip data removes formatting #137

Open AKK-Tech opened 3 years ago

AKK-Tech commented 3 years ago

Hi,

If I copied data from note or some other applications, I can't get the correct format when I paste it. Could you help me please if you have a time to explain?

Thanks.

chinalwb commented 3 years ago

Hi,

When pasting content to the editor, the editor's onTextChanged method will be triggered, so I think you need to parse the pasted content from html into Spannable (using Html.fromHtml(html) ), then update the editor with the result.

I am not 100% sure about this but it worths a try.

Thanks.

AKK-Tech commented 3 years ago

Thanks you for your reply sir. I'll try this.

easy-apps-2018 commented 3 years ago

@AKK-Tech Hey, did you test it,? Succeeded?