0 Votes

Changes for page AutoGallery

Last modified by Ryan C on 2025/06/17 16:30

From version 3.15
edited by Ryan C
on 2025/06/17 16:25
Change comment: There is no comment for this version
To version 3.14
edited by Ryan C
on 2025/06/17 16:24
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -10,8 +10,7 @@
10 10  } else {
11 11   html << "<div style='display: flex; flex-wrap: wrap; gap: 10px;'>"
12 12   attachments.each { att ->
13 - def safeFilename = $escapetool.url(att.filename)
14 - def url = "${doc.getExternalURL('download')}/${safeFilename}"
13 + def url = "${doc.getExternalURL('download')}/${att.filename.encodeAsURL()}"
15 15   html << "<div style='margin: 5px; display: inline-block;'>"
16 16   html << "<img src='${url}' style='max-width: 200px;' />"
17 17   html << "</div>"
... ... @@ -20,5 +20,6 @@
20 20  }
21 21  
22 22  wikimacro.result = $services.rendering.parse(html.toString(), "xhtml/1.0").getChildren()
22 +
23 23  {{/groovy}}
24 24