Feat/text and image alignment in glfm
- Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
Add new .float-left .float-none .float-right attributes to images in GLFM and support for glfm-float-* classes that can be used on HTML embedded directly in the markdown.
This MR explicitly does not intetionally does not expose float controls as part of the RTE as discussed in #224950 (comment 3229574336) - this is something that can be followed up on.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Edit a markdown field in plaintext
- Embed an image either using
[](){}syntax or<img> - When using the markdown image syntax, apply one of the
.float-left .float-right .float-noneattributes to the image - When using the HTML image syntax, apply one of
glfm-float-left glfm-float-right glfm-float-noneclasses to the image tag - Save the changes to view float applied correctly.
The following markdown can be used to verify the results (kudos to @kivikakk for using cute cat pics as the test subjects):
## `![](){}`
{.float-left width=200 height=200}
{.float-right width=200 height=200}
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
## `<img>`
<img src="https://cataas.com/cat?3" class="glfm-float-left" width="200" height="200">
<img src="https://cataas.com/cat?4" class="glfm-float-right" width="200" height="200">MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Callum MacLeod


