0 Votes

Wiki source code of scripttest

Last modified by Ryan C on 2025/05/06 20:38

Hide last authors
Ryan C 1.1 1 (% class="jumbotron" %)
Ryan C 21.1 2 (((
Ryan C 1.1 3 (% class="container" %)
Ryan C 21.1 4 (((
5 = Attachment Rename Script Test Page =
Ryan C 1.1 6
Ryan C 21.1 7 This page is used to test all known edge cases for attachment renaming and broken reference recovery.
Ryan C 1.1 8
Ryan C 21.1 9 == โœ… Working Link with Bad Filename ==
Ryan C 24.1 10 This should show a valid image but with a bad filename like `a b.jpg`, which will be renamed to `a_b.jpg`.
11 {{velocity}}
12 <img src="$doc.getAttachmentURL('a b.jpg')" width="300" />
13 {{/velocity}}
Ryan C 1.1 14
Ryan C 24.1 15 == ๐Ÿงผ Already-clean filename ==
16 [[image:already_clean.jpg]]
Ryan C 1.1 17
Ryan C 21.1 18 == ๐Ÿ’ฅ Broken reference (does not exist at all) ==
Ryan C 24.1 19 [[image:nonexistent[broken].jpg]]
Ryan C 1.1 20
Ryan C 21.1 21 == ๐Ÿ” Previously renamed (should be fixed if stale) ==
Ryan C 24.1 22 {{velocity}}
23 <img src="$doc.getAttachmentURL('bad name.jpg')" width="250" />
24 {{/velocity}}
Ryan C 1.1 25
Ryan C 24.1 26 == ๐Ÿง  Fuzzy-match candidate (actual file is `a_b.jpg`) ==
Ryan C 47.1 27 [[image:a b.jpg]]
Ryan C 1.1 28
Ryan C 24.1 29 == ๐Ÿงช Badly-encoded filename with leftover macro syntax ==
Ryan C 47.1 30 [[image:blacks_counted_as_white_injustice_ethnicity_image_images_non-hispanic_race_texas_white.jpg].jpg]]
Ryan C 1.1 31
Ryan C 24.1 32 == ๐Ÿงฑ HTML Embed (should still work after rename) ==
33 {{velocity}}
34 <img src="$doc.getAttachmentURL('a b.jpg')" width="200" />
35 {{/velocity}}
Ryan C 1.1 36
Ryan C 24.1 37 == โš™๏ธ Velocity-based Embed with bad name ==
Ryan C 21.1 38 {{velocity}}
Ryan C 24.1 39 <img src="$doc.getAttachmentURL('bad name.jpg')" width="200" />
Ryan C 21.1 40 {{/velocity}}
Ryan C 1.1 41
Ryan C 26.1 42 == ๐ŸŽž Embedded MP4 (should be renamed and still playable) ==
43 {{video attachment="bad video.mp4"/}}
Ryan C 1.1 44
Ryan C 24.1 45 == ๐Ÿ“Š Gallery Rendering ==
Ryan C 21.1 46 {{gallery columns="3"}}
47 image:a b.jpg
48 image:already_clean.jpg
49 image:comparison.png
50 image:1000000503.jpg
51 {{/gallery}}
Ryan C 1.1 52
Ryan C 24.1 53 == ๐Ÿ“Ž Attachment Reference ==
54 [[Archived Chart>>attach:comparison.png]]
Ryan C 21.1 55
Ryan C 24.1 56 {{putFootnotes/}}
Ryan C 1.1 57 )))
Ryan C 24.1 58 )))
Ryan C 1.1 59

XWiki AI Chat