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

{noformat} and {code} macros (possibly others) truncate newline when double newline pasted in

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Low Low
    • None
    • 5.1
    • None

      I found this issue when pasting a gpg ascii armored from my terminal into a noformat block, pulling it back out and attempting to import it on another system.

      It would appear that the noformat and code blocks truncate a single newline in double newline situations which made the gpg key invalid and unable to import.

      I looked at the hex values to make sure i wasn't crazy:

      content on original system:

      0000000: 2d2d 2d2d 2d42 4547 494e 2050 4750 2050  -----BEGIN PGP P
      0000010: 5542 4c49 4320 4b45 5920 424c 4f43 4b2d  UBLIC KEY BLOCK-
      0000020: 2d2d 2d2d 0a56 6572 7369 6f6e 3a20 476e  ----.Version: Gn
      0000030: 7550 4720 7631 2e34 2e35 2028 474e 552f  uPG v1.4.5 (GNU/
      0000040: 4c69 6e75 7829 0a0a 6d51 4769 4245 2f49  Linux)..mQGiBE/I
      0000050: 354c 4d52 4241 4350 7150 686c 524d 462f  5LMRBACPqPhlRMF/
      0000060: 4e63 6938 526c 386a 2b6c 7550 6654 4f31  Nci8Rl8j+luPfTO1
      

      gpg key after pasting into and copying out of a noformat macro:

      0000000: 2d2d 2d2d 2d42 4547 494e 2050 4750 2050  -----BEGIN PGP P
      0000010: 5542 4c49 4320 4b45 5920 424c 4f43 4b2d  UBLIC KEY BLOCK-
      0000020: 2d2d 2d2d 0a56 6572 7369 6f6e 3a20 476e  ----.Version: Gn
      0000030: 7550 4720 7631 2e34 2e35 2028 474e 552f  uPG v1.4.5 (GNU/
      0000040: 4c69 6e75 7829 0a6d 5147 6942 452f 4935  Linux).mQGiBE/I5
      0000050: 4c4d 5242 4143 5071 5068 6c52 4d46 2f4e  LMRBACPqPhlRMF/N
      0000060: 6369 3852 6c38 6a2b 6c75 5066 544f 3153  ci8Rl8j+luPfTO1S
      

      Steps to reproduce:
      1. in your favorite text editor type in anything separated by two newlines:

      foo
      
      bar
      

      2. Paste that in to a noformat or code block.
      3. copy back out into favorite text editor.

      Expected outcome: all newlines preserved
      Actual outcome: single newline truncated

      Editing the source and inserting a newline inside the norformat block works around the issue.

              shaffenden Steve Haffenden (Inactive)
              6437eebde4cf Donovan Lampa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: