Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-24952

Mangled clipboard copy of {code} block after doubleclick

    XMLWordPrintable

Details

    Description

      I create a confluence page with the following code section. Curly braces replaced with square ones to avoid formatting, note multiple spaces after "has":

      [code]
      Can I has   a breakable space bug
      [code]
      

      If I select the text using point&drag, after Cmd+C the clipboard content is as expected:

      $ pbpaste | hexdump -C
      00000000  43 61 6e 20 49 20 68 61  73 20 20 20 61 20 62 72  |Can I has   a br|
      00000010  65 61 6b 61 62 6c 65 20  73 70 61 63 65 20 62 75  |eakable space bu|
      00000020  67                                                |g|
      

      However, if I double click the code section to select everything and then hit Cmd+C, multiple spaces get mangled and changed to something that looks like unicode unbreakable space:

      $ pbpaste | hexdump -C
      00000000  43 61 6e 20 49 20 68 61  73 c2 a0 c2 a0 20 61 20  |Can I has.... a |
      00000010  62 72 65 61 6b 61 62 6c  65 20 73 70 61 63 65 20  |breakable space |
      00000020  62 75 67                                          |bug|
      00000023
      [bok@bokbook ~]$ 
      

      This occurs in on my Mac in both Safari and Chrome, not in Firefox, so it may be technically more a WebKit bug, but since "doubleclick to select entire section" is Confluence's feature, not browser's, I'm filling this bug here.

      Workaround:

      As the No Format macro doesn't allow for double click selection, one potential solution is to disable the Code Macro (by going to Confluence Admin > Manage Add-ons > System Add-ons) and then create a user macro called something like 'code' with the template: <ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[ $body]]></ac:plain-text-body></ac:macro>, which means that whenever someone goes to create a code macro, they instead make a No Format macro.

      Attachments

        Issue Links

          Activity

            People

              jmcarthur James McArthur (Inactive)
              ee656ad86eae Bob Koutsky
              Votes:
              24 Vote for this issue
              Watchers:
              26 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: