Skip to content

Preserve filenames when inserting media into entries - #369

Merged
snoopdave merged 1 commit into
roller-6.1.xfrom
editor-media-insert-6.1.x
Nov 21, 2026
Merged

snoopdave merged 1 commit into
roller-6.1.xfrom
editor-media-insert-6.1.x

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

The rich-text editor's media chooser built its link and image markup by string concatenation. This ports master's approach from #233.

  • Filenames stay literal. The inserted link and image are built with jQuery text and attribute setters, so quotes, angle brackets and ampersands in a media file's name come through as typed.
  • Thumbnails unchanged. Images still use the thumbnail (?t=true) when one exists and the original otherwise.
  • Tests. Three new RichEditorContentIT cases fail without the change and pass with it (the whole class passes, 10 tests). The app unit suite passes on JDK 11 (814 tests).

Not covered: a full browser run through a live Roller instance; the tests check the chooser's output before Summernote receives it.

@mraible mraible left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and it matches master's #233. The chooser reads the name and URL from data attributes that <s:property> escapes, and with the link and image now built with attr and text, the name stays text all the way into the editor.

@snoopdave
snoopdave merged commit 445a850 into roller-6.1.x Nov 21, 2026
7 checks passed
@snoopdave
snoopdave deleted the editor-media-insert-6.1.x branch November 21, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants