Skip to content

Model registry UI: Allow for attachments in description

Attachments are currently disabled in the markdown description. It seems that when enabled, attachments do get uploaded but they get rendered incorrectly.

When adding an image to the markdown description its displayed in plain text as:

![image](/uploads/15cdbd74858d6c6c3164a378f6f736fc/gitlab_logo.png){width=769 height=320}

The image is uploaded upon saving and store in: http://127.0.0.1:3000/-/project/7/uploads/15cdbd74858d6c6c3164a378f6f736fc/gitlab_logo.png

So uploading does work and goes as expected. However when viewing the description the image is not rendered as it points to an incorrect location:

http://127.0.0.1:3000/uploads/15cdbd74858d6c6c3164a378f6f736fc/gitlab_logo.png

When clicking edit and switching to the rich text editor, the image is rendered correctly.

Root cause

The images are not loaded due to the lazy-loader looking at body-content while the modal is a level higher at body, when making the appropriate change in the lazy loader the images do preview in the modal.

See below video of first the issue and then broadening the lazy loader scope to see it work.

Schermopname_2024-08-26_om_12.05.36

Edited by Fred de Gier