0 Votes

Changes for page Incidents list

Last modified by Ryan C on 2025/07/14 15:42

From version 4.1
edited by Ryan C
on 2025/07/14 14:05
Change comment: There is no comment for this version
To version 5.1
edited by Ryan C
on 2025/07/14 14:13
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -18,16 +18,17 @@
18 18   def rawHeadline = obj.getProperty('headline')?.value
19 19   def headline = (rawHeadline instanceof String) ? rawHeadline.trim() : null
20 20  
21 - def rawUrl = obj.getProperty('url')?.value
21 + def rawUrl = obj.getProperty('URL')?.value
22 22   def url = (rawUrl instanceof String) ? rawUrl.trim() : null
23 23  
24 - def isValidUrl = url?.toLowerCase()?.startsWith("http")
25 -
24 + def isValidUrl = (url ==~ /(?i)^https?:\/\/.+/)
26 26   def label = (headline && headline.length() > 0) ? headline : (fallbackTitle ?: docName)
27 27  
28 28   if (isValidUrl) {
29 - println "* [[${label}>>'${url}']]"
28 + // CORRECT syntax per official XWiki link rules
29 + println "* [[${label}>>${url}]]"
30 30   } else {
31 + // Fallback to internal doc
31 31   println "* [[${label}>>doc:${docName}]]"
32 32   }
33 33   }

XWiki AI Chat