Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to support text/html and text/plain in parallel when one or the other is available. #107

Open
danvln opened this issue Oct 11, 2020 · 2 comments

Comments

@danvln
Copy link

danvln commented Oct 11, 2020

It would be great to have the option to support text/html and text/plain in parallel when one or the other is available.

For example: paste in notepad the text/plain and paste in MS Word text/html.

@gargroh
Copy link

gargroh commented Oct 28, 2020

This worked for me

copyToClipboard(plainTxt, {
	format: 'text/plain',
	onCopy: (clipboardData) => {
	  // copy rich text also
	  clipboardData.setData('text/html', html);
	}
});

@leslie555
Copy link

             onClick={() => {
                  const content = editorRef.current.getInstance().getHtml();
                  copy(content, {
                    format: 'text/plain',
                    onCopy: clipboardData => {
                      (clipboardData as any).setData('text/html', content);
                      message.success('Successfully copy daily report');
                    },
                  });
                }}

@gargroh 's method is worked fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants