Loading
fix: do not append media dimensions to non-embeddable links
What does this MR do and why?
This MR fixes an issue where media dimensions ({width=... height=...}) were incorrectly appended to non-embeddable media links when pasting files into the plain text editor.
By adding a guard clause (if (!md.startsWith('!')) return md;) in transformMediaMarkdown inside app/assets/javascripts/dropzone_input.js, we ensure that only properly embeddable media formats get the dimension attributes. This prevents stray brackets from rendering as literal text for unsupported video formats like .mkv or .bin.
Closes #632782
Screenshots or screen recordings
No visual UI changes, but the generated markdown text in the textarea no longer contains stray dimensions.
How to set up and validate locally
- Open any issue or merge request to view the plain text editor.
- Copy and paste a non-embeddable video file (e.g., a
.mkvfile or any dummy file with a.binextension) into the textarea. - Verify that the generated markdown is simply
[filename.mkv](/url/to/file)and does not have{width=... height=...}appended.
MR acceptance checklist
This MR has been evaluated against the MR acceptance checklist.