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

First image inserted with Rich Text Editor actually inserts wiki tag as text

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 4.0
    • 2.1.4
    • None
    • Hosting Environment: Apache 2.0.54, Tomcat 5.0.28
      Client: Firefox 1.5.0.1

      Using the rich text editor to insert an image in a page, the first image inserted looks fine in the editor, but when you save, the displayed page shows the wiki tag rather than the image. Editing the page again shows that the RTE has added
      
       \!imagename.png\! 
      
      in the wiki markup. This happens for both png and jpg files.
      
      Adding a subsequent image using the RTE works properly. The problem can be worked around by editing the wiki markup directly.
      
      FYI, Confluence version is 2.1.4 Build#410 with an evaluation license key.
      
      Apologies if this is a dupe - I searched and couldn't find any similar issues.
      

            [CONFSERVER-5569] First image inserted with Rich Text Editor actually inserts wiki tag as text

            Don Willis added a comment -

            I've fixed one problem with images and following text for the next release, but I should go through all the edge cases listed here and make sure they're covered.

            Don Willis added a comment - I've fixed one problem with images and following text for the next release, but I should go through all the edge cases listed here and make sure they're covered.

            The general problem here is that for the markup for an embedded image to render or interpret correctly there needs to be spaces around it. When text is too close (either before or after), the markup breaks.

            So foo!image.png! breaks and so does !image.png!bar.

            Fix this by ensuring we put an appropriate separation char when round tripping images and text.

            dave (Inactive) added a comment - The general problem here is that for the markup for an embedded image to render or interpret correctly there needs to be spaces around it. When text is too close (either before or after), the markup breaks. So foo!image.png! breaks and so does !image.png!bar. Fix this by ensuring we put an appropriate separation char when round tripping images and text.

            Environment description for the previous comment:

            • Confluence 2.2.8
            • Websphere as application server
            • Oracle as RDBMS

            Reproduce under FireFox 1.5.0.6 and Internet Explorer 6.0 (SP2)

            Alberty Pascal added a comment - Environment description for the previous comment: Confluence 2.2.8 Websphere as application server Oracle as RDBMS Reproduce under FireFox 1.5.0.6 and Internet Explorer 6.0 (SP2)

            I have a similar experience here.

            1. Create a new page
            2. Use the Rich text editor and type

            {section}{column}{section}

            on the first
            3. Go to Wiki Markup and go back to Rich Text editor
            4. Put your cursor after the first

            {column}

            5. Click on insert image, import one and insert it
            6. Go to Wikimarkup editor

            => No picture !

            It is possible to reproduce this issue in other cases.

            Please, could it be possible to increase the issue priority ?

            Thanks

            Alberty Pascal added a comment - I have a similar experience here. 1. Create a new page 2. Use the Rich text editor and type {section}{column}{section} on the first 3. Go to Wiki Markup and go back to Rich Text editor 4. Put your cursor after the first {column} 5. Click on insert image, import one and insert it 6. Go to Wikimarkup editor => No picture ! It is possible to reproduce this issue in other cases. Please, could it be possible to increase the issue priority ? Thanks

            Sorry, forgot to recommend a simple solution:
            Basically, we need a way to distinguish whether an image is attempted to be inserted right after the text, hence no <space> used.

            IF first character after the text is NOT a space
            enforce insertion of a <space> before the image tag

            Note: Interestingly, when the word is terminated by a special character such as :,#$%^, no <space> is required. It works fine ?

            Ivan Benko [Atlassian] added a comment - Sorry, forgot to recommend a simple solution: Basically, we need a way to distinguish whether an image is attempted to be inserted right after the text, hence no <space> used. IF first character after the text is NOT a space enforce insertion of a <space> before the image tag Note: Interestingly, when the word is terminated by a special character such as :,#$%^, no <space> is required. It works fine ?

            Follow these steps to reproduce the error with Wiki Markup new line character "\"

            1.Create a test page (if you already don't have one)
            2. Type in some text under "Rich Text" mode, for example
            Insert an image here

            3. Use the "Insert/Edit image" button to attempt inserting an image
            4. Select an image to be inserted (out of available images, if none available use Browse to fetch one)
            5. After inserting the selected image into the page right after the typed text, it appears to be correct, nevertheless
            if one attempts to swap the mode into the "Wiki Markup" mode or using "Save" to exit, the outputted result does not contain the image!
            Instead it contains :

            Insert an image here!Touring Sydney Monday.jpg!

            Below is a process summary

            Valid result: (using a space between a text and an inserted image)

            Rich text: Insert an image here<space>
            Wiki Markup: Insert an image here<space> !<image_name>!
            Preview: Insert an image here <the actual image displayed>

            Invalid result: (no space used after the initial text)

            Rich Text: Insert an image here!Touring Sydney Monday.jpg!
            Wiki Markup: Insert an image here!Touring Sydney Monday.jpg!
            Preview: Insert an image here!Touring Sydney Monday.jpg!

            Ivan Benko [Atlassian] added a comment - Follow these steps to reproduce the error with Wiki Markup new line character "\" 1.Create a test page (if you already don't have one) 2. Type in some text under "Rich Text" mode, for example Insert an image here 3. Use the "Insert/Edit image" button to attempt inserting an image 4. Select an image to be inserted (out of available images, if none available use Browse to fetch one) 5. After inserting the selected image into the page right after the typed text, it appears to be correct, nevertheless if one attempts to swap the mode into the "Wiki Markup" mode or using "Save" to exit, the outputted result does not contain the image! Instead it contains : Insert an image here!Touring Sydney Monday.jpg! Below is a process summary Valid result: (using a space between a text and an inserted image) Rich text: Insert an image here<space> Wiki Markup: Insert an image here<space> !<image_name>! Preview: Insert an image here <the actual image displayed> Invalid result: (no space used after the initial text) Rich Text: Insert an image here!Touring Sydney Monday.jpg! Wiki Markup: Insert an image here!Touring Sydney Monday.jpg! Preview: Insert an image here!Touring Sydney Monday.jpg!

            Hi Pete,

            That is deliberate, since you cannot link to attached images when there are not yet attachments to the page. Once the page has been saved (and the user is able to save attachments), the button is enabled.

            Jeremy.

            Jeremy Higgs added a comment - Hi Pete, That is deliberate, since you cannot link to attached images when there are not yet attachments to the page. Once the page has been saved (and the user is able to save attachments), the button is enabled. Jeremy.

            Tried on the Confluence site and it worked properly. (See page named
            'CONF-5569 test' in Test Space).

            Don't know why it doesn't work properly for me. When I get time, I'll do a
            clean install and see if it happens on that.

            By the way, is the fact that the image button in the RTE doesn't appear when
            creating a new page a deliberate feature or should this be reported as a bug
            too?

            Cheers,

            Pete

            Peter Whitfield added a comment - Tried on the Confluence site and it worked properly. (See page named ' CONF-5569 test' in Test Space). Don't know why it doesn't work properly for me. When I get time, I'll do a clean install and see if it happens on that. By the way, is the fact that the image button in the RTE doesn't appear when creating a new page a deliberate feature or should this be reported as a bug too? Cheers, Pete

            I'll give it a try...

            Peter Whitfield added a comment - I'll give it a try...

            Peter,

            There shouldn't be any configuration you can change which would cause this.

            Can you reproduce it on http://confluence.atlassian.com ?

            Thanks,
            Tom

            Tom Davies added a comment - Peter, There shouldn't be any configuration you can change which would cause this. Can you reproduce it on http://confluence.atlassian.com ? Thanks, Tom

              smansour Sherif Mansour
              d6df232f62e4 Peter Whitfield
              Affected customers:
              3 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: