Copy/paste diff code block into paragraph includes extra content

XMLWordPrintable

    • 1
    • Severity 3 - Minor
    • 470

      Issue Summary

      This is reproducible on Data Center: N/A

      Steps to Reproduce

      1. Go to PR with code diff
      2. Highlight a few lines of code and copy to clipboard 
      3. Click "Add comment" button to open comment editor 
      4. Paste content from clipboard into the blank editor (by default it uses paragraph formatting)
      5. For example, if you copied this diff to your clipboard:

      Expected Results

      Pasted content only includes code 

      Actual Results

      Pasted content includes code, line numbers, extra lines, "Added" or "Removed" text

      function sayHey(name?: string): string {
      
      2
      +Added:  return `Hey ${name}!`;
      
      3
      +Added:} 

      Workaround

      User can paste content into a code block (by clicking code block option from editor or using 3 back ticks) and it will be formatted correctly. 

            Assignee:
            Unassigned
            Reporter:
            Ellie Matsusaka Sherwood
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: