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

Code macro does not maintain line breaks or code indentations in IE8

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Medium Medium
    • None
    • 4.0
    • None
    • Google Chrome: 14.0.835.187 m
      Copy from Visual Studio 2010

      Whenever copying code into the Code macro, it seems to strip away all line breaks and indentations, this is highly annoying as you then have to manually format all that.

        1. HttpMethods.cs
          1 kB
        2. Level.cs
          1 kB

            [CONFSERVER-23564] Code macro does not maintain line breaks or code indentations in IE8

            Won't Fix? Seriously?

            By the way, I also have this problem with JIRA issues. So basically Atlassian UI, which should be dev-friendly, makes it super hard for devs to use it.

            Felipe Carasso added a comment - Won't Fix? Seriously? By the way, I also have this problem with JIRA issues. So basically Atlassian UI, which should be dev-friendly, makes it super hard for devs to use it.

            dunderhill added a comment -

            Work Around

            1) Edit Confluence Page
            2) Choose Markup from the Insert menu (plus sign with down arrow)
            3) In the Insert pane, type {code}{code}
            4) Copy the code you want to be reviewed (from any other editor)
            5) Paste code snippet in between code tags
            6) Click the Insert button
            7) Select just the text from the resulting Code Block on the edit page by setting the cursor before the first character and then shift-clicking after the last character
            8) Copy selected text
            9) Click outside code block and paste text directly on page
            10) Click title bar of Code Block and type Delete key
            11) Click Publish to save page

            dunderhill added a comment - Work Around 1) Edit Confluence Page 2) Choose Markup from the Insert menu (plus sign with down arrow) 3) In the Insert pane, type {code}{code } 4) Copy the code you want to be reviewed (from any other editor) 5) Paste code snippet in between code tags 6) Click the Insert button 7) Select just the text from the resulting Code Block on the edit page by setting the cursor before the first character and then shift-clicking after the last character 8) Copy selected text 9) Click outside code block and paste text directly on page 10) Click title bar of Code Block and type Delete key 11) Click Publish to save page

            yiyun added a comment -

            Ari Brown: I have this issue in the Markdown macro as well.

            David Tonhofer: thanks for your work around, it somewhat works for me. And the page doesn't get killed (I'm editing for markdown macro).

            yiyun added a comment - Ari Brown: I have this issue in the Markdown macro as well. David Tonhofer: thanks for your work around, it somewhat works for me. And the page doesn't get killed (I'm editing for markdown macro).

            Observed on "Confluence Cloud" in Firefox 38.0.5 on Fedora 20.

            Workaround is to paste to Confluence page, the copy from page into macro window.

            This however, may actually "kill the page" - it becomes uneditable with the cursor stuck in the macro header. Sometimes it mangles "long lines" only.

            David Tonhofer added a comment - Observed on "Confluence Cloud" in Firefox 38.0.5 on Fedora 20. Workaround is to paste to Confluence page, the copy from page into macro window. This however, may actually "kill the page" - it becomes uneditable with the cursor stuck in the macro header. Sometimes it mangles "long lines" only.

            Ari Brown added a comment -

            Huge issue for us as well. Also applies to the Markdown macro, which probably leverages the same plumbing. This is making an import from another system basically impossible. Any movement?

            Ari Brown added a comment - Huge issue for us as well. Also applies to the Markdown macro, which probably leverages the same plumbing. This is making an import from another system basically impossible. Any movement?

            This issue appears to be happening in the newest version of Confluence. If you copy and paste code into a code block any blank lines will be removed in the resulting pasted text. I tested this with several editors, several browsers, and talked to technical support who also confirmed the issue on their end.

            Jason Riffel added a comment - This issue appears to be happening in the newest version of Confluence. If you copy and paste code into a code block any blank lines will be removed in the resulting pasted text. I tested this with several editors, several browsers, and talked to technical support who also confirmed the issue on their end.

            While the original issue across all browsers was fixed, as some have reported this still happens in IE8 as it will replace tabs with spaces when pasting into a container which is contentEditable. Unfortunately there is nothing that we can do about this.

            If you'd like to verify this yourself, create an html page with a div in it that has a contentEditable="true" attribute. Try pasting text with tabs and see what happens.

            As such I've updated the title to specifically reference IE8 and closing the ticket.

            John Masson added a comment - While the original issue across all browsers was fixed, as some have reported this still happens in IE8 as it will replace tabs with spaces when pasting into a container which is contentEditable. Unfortunately there is nothing that we can do about this. If you'd like to verify this yourself, create an html page with a div in it that has a contentEditable="true" attribute. Try pasting text with tabs and see what happens. As such I've updated the title to specifically reference IE8 and closing the ticket.

            I get the problem with IE8 and Confluence 4.2 pasting from either the Visual Basic 6 IDE or the UltraEdit text editor.

            Nick Gibbons added a comment - I get the problem with IE8 and Confluence 4.2 pasting from either the Visual Basic 6 IDE or the UltraEdit text editor.

            I got the problem in IE8, copying and pasting from putty windows or from another IE8 browser window. IE8 is still the company standard so this is a blocker for our upgrade.

            Ursula Schwantag added a comment - I got the problem in IE8, copying and pasting from putty windows or from another IE8 browser window. IE8 is still the company standard so this is a blocker for our upgrade.

            Anatoli added a comment -

            Just tested copying from notepad - and got the wrong behavior. Will re-open the issue.

            Anatoli added a comment - Just tested copying from notepad - and got the wrong behavior. Will re-open the issue.

              jmasson@atlassian.com John Masson
              908a536c2a1d Jens
              Affected customers:
              20 This affects my team
              Watchers:
              35 Start watching this issue

                Created:
                Updated:
                Resolved: