typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 56 forks source link

Pasting from Google Docs does not preserve code formatting #5978

Open teamshortcut opened 8 months ago

teamshortcut commented 8 months ago

Describe the bug When copy-pasting from Google Docs into Typora, most formatting is really well preserved. However, any code blocks or inline code formatting is lost when pasting into Typora.

To Reproduce Steps to reproduce the behavior:

  1. Create a Google Doc
  2. Add some code blocks. If you have markdown detection on, you can use backticks, or you can insert a code block by selecting Insert > Building blocks > Code blocks.
  3. Copy the document. (CTRL+A, CTRL+C)
  4. Open a new Typora document and paste.

Expected behavior Pasted content should preserve the code blocks and formatting.

Screenshots / Screencasts Here is an example Google Doc, and the result of pasting it into Typora. image

Here is what I would expect to happen instead. (this is just an example, I manually edited the Typora document for this) image

Sample Markdown File N/A

Desktop (please complete the following information):

Typora Version 1.8.10

Additional context The amazing magical conversion between Google Docs and markdown is actually the reason that Typora was originally recommended to me, so I would love this small discrepancy to be fixed!

lekeny commented 7 months ago

Can we please add this capability to preserve code formatting when pasting from Google Docs into Typora? This is especially helpful when authoring technical documentation which very commonly includes codes.

This will make Typora a whole lot more attractive to Technical Writers who need to author technical documentation in places like Google Doc then convert it into markdown to publish.

Thank you!

rcsh1 commented 7 months ago

Our developer docs contain a lot of code blocks and manually adding ''' is quite tedious and error-prone, so I'd really appreciate it if this issue could be fixed.