mark icon indicating copy to clipboard operation
mark copied to clipboard

Add ac:image for image attachments

Open thomasschuiki opened this issue 3 years ago • 5 comments

The new confluence editor creates images with a surrounding macro that is not currently inserted by mark.

Initially uploading an image with mark creates a standard <img> tag in the wiki-page. Upon editing the page and hitting publish it will be converted to the new format. Which looks like this

<ac:image ac:alt="gitlab logo">
<ri:url ri:value="/wiki/download/attachments/2060943490/._gitlab-icon-rgb.png?api%3Dv2%26cacheVersion%3D1%26modificationDate%3D1617278160533%26version%3D1" />
</ac:image>

Unfortunately the image still can't be edited like if it was inserted via the editor. But that's a conversion issue from atlassian.

If we insert an image through the new editor the storage format looks like this:

<ac:image ac:align="center" ac:layout="center" ac:original-height="671" ac:original-width="1008">
<ri:attachment ri:filename="bg.jpg" ri:version-at-save="1" />
</ac:image>

Would be nice to have this :) I didn't test anything else yet so there might be some other issues with the new editor/storage format.

thomasschuiki avatar Apr 01 '21 12:04 thomasschuiki

The official documentation for the image storage format can be found here: https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html#ConfluenceStorageFormat-Images

thomasschuiki avatar Apr 01 '21 12:04 thomasschuiki

It would also be nice if the utility respected image dimensions. Not sure if the implementation is stateful (doesn't appear to be), but that would be really convenient if it could detect the same image name and avoid changing any custom settings give to that tag.

BrutalSimplicity avatar Sep 02 '21 20:09 BrutalSimplicity

By default, md annotation for image

![](path)

is not well interpretated (image size issue, impossible for zooming, ...). It could be interresting to use "ac:image" macro by default What do you think?

malys avatar Sep 27 '21 08:09 malys

Hi, I have implemented a solution that is covering my UC. I replace ![](xxxxxx) by ac:image macro See my branch and macro declaration

<!-- Macro: \!\[\]\((.+)\)
     Template: ac:image
     Attachment: ${1} --> 

It's limited but working fine. It's could be interesting for @thomasschuiki.

malys avatar Oct 12 '21 06:10 malys

@malys could you open a PR with your changes? Would be great to see this in the tool :)

slaughtr avatar Apr 21 '22 19:04 slaughtr

This got added via https://github.com/kovetskiy/mark/issues/245

mrueg avatar May 22 '23 15:05 mrueg