I've noticed that pasting images along with text using Ctrl + V isn't functioning as expected. The images are being removed/stripped from the content. Additionally, I can view the images when I preview the response, but they are not visible when I send the reply.

Preview:

Response:

System Info:

system info:

Thanks.

    kirandev92

    What does the raw html look like before posting reply? Do you have Allow External Images setting enabled?

    Cheers.

      KevinTheJedi

      Below is the Html format before posting the reply.

      <p><br>Test image:<br></p><figure><img src="https://lh7-us.googleusercontent.com/wTJug3qiP8hilnHXOM-Kvkp3HYmjMgw5s_hJ5jBR7lKpH_DzNJZMXpxsvbKn3pbns-G8ut1GrCjvrcFAVbbYodDd5GF66p-jegsKKyjmFwmBRP2mXG1tHv3HsO4t5LMe7iQgGiTM5NFadO4lq1R1Z8o" width="624" height="172" data-image="iw3796b521e6"></figure>
      <p><br><br></p>
      <p dir="ltr">This is a test image. </p>
      <p dir="ltr">This is a test image. This is a test image. This is a test image. This is a test image. This is a test image.</p>
      <p><br></p>

      Yes Allow External Images setting is enabled.

        kirandev92

        How did you copy the image and text? From a Google Docs document or? Please provide exact steps so I can replicate.

        Cheers.

          KevinTheJedi

          Yes, I have copied it from Google Docs. The process involves selecting all the content from a Google Docs document using Ctrl + A, Copying it with Ctrl + C, and then pasting it using Ctrl + V.

          6 days later

          kirandev92

          I’m extremely busy so haven’t gotten to this yet. I will post if I have an update.

          Cheers.

          kirandev92

          I just tested this and was not able to replicate the issue. This is what copy/pasting a Google Doc with text + Inline Image looks like for me:

          Cheers.

          7 days later

          kirandev92

          I have not commented which means I have no update yet. Legacy is in maintenance mode so it’s lower on the priorities. Rest assured it’s on my legacy todo list.

          The code is fully open-source so you can take a crack at it yourself to speed up the process if desired.

          Cheers.

          I had a similar problem. I just checked the MIME type in the attachment settings. I'm sure it could be the probelem, but I've just sorted it out with the MIME type declaration.

            6 days later

            Eiltesir Sorry for the late response. I have checked the MIME type in the attachment settings as suggested. Yet I am able to reproduce the issue.

            21 days later

            Everyone,

            So after further review I can see that the code is whitelisting certain image extensions to be displayed inline ('gif', 'png', 'jpg', and 'jpeg'). This is to help prevent code execution attacks (through SVG for example) and other similar attacks. Since Google Docs doesn't add a file extension to the end of the image URL our system sees it as sketchy and removes it. There is no way to change this behavior at this time unless you modify the codebase. You would do so at your own risk as you would potentially open yourself up to different attacks.

            Just to note, the setting Allow External Images needs to be enabled for the system to allow any external images in the first place. However, in this case even with the setting enabled those images are stripped as they do not contain an extension to identify itself as to what type of image/file it is.

            I will discuss with the team to see if we can improve this in any way but there are no guarantees and no expected timeline. It will simply be added to a list of things to review later on at some point.

            Cheers.

            Write a Reply...