mark
mark copied to clipboard
Add ac:image for image attachments
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.
The official documentation for the image storage format can be found here: https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html#ConfluenceStorageFormat-Images
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.
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?
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 could you open a PR with your changes? Would be great to see this in the tool :)
This got added via https://github.com/kovetskiy/mark/issues/245