Copy pasting from Google docs looses formatting and wraps text in "**"

I haven’t tried this plugin myself, but this plugin might help:

Of note it can do custom regex cleanup when pasting, e.g. one of the examples is converting google docs inline css styles to semantic formatting:

  1. Convert Google Docs span styles to semantic elements
  • Pattern: <span style="font-weight:\s*bold[^"]*">(.*?)</span>
  • Replacement: <strong>$1</strong>
  • Description: Converts Google Docs styled spans to proper HTML elements

If that regex pattern alone doesn’t fix it the ** above/below the pasted text, you might be able to add some regex in the post processing stage (Markdown Regex Replacements) to remove ** if it’s on its own line with no other content

2 Likes