Skip to content

Commit

Permalink
XWiki export doesn't work properly when a diagram is present. xwikis…
Browse files Browse the repository at this point in the history
…as#311

 * Small fixes
  • Loading branch information
Farcasut committed Nov 27, 2024
1 parent 3be90c6 commit a30f2ee
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,13 @@
#if ($xcontext.action == 'export' && $diagramObj.getValue('exportUsingSVG') == 0
&& $diagram.getAttachment($pngFileName))
#set ($fileName = $pngFileName)
#set ($diagramURL = $diagram.getAttachmentURL($fileName, 'download', "v=$!diagram.version"))
#set ($output = "{{html clean='false'}}<img src='$diagramURL' alt='$escapetool.xml($diagramTitle)'/>{{/html}}")
#elseif ($xcontext.action == 'export')
#set ($diagram = $xwiki.getDocument($reference))
#set ($output = "{{html}}<div>$diagram.getAttachment('diagram.svg').getContentAsString()</div>{{/html}}")
#else
## If we reached this branch it means that we are in 'view' mode, and we should use the svg.
#set ($diagramURL = $diagram.getAttachmentURL($fileName, 'download', "v=$!diagram.version"))
#set ($output = "{{html clean='false'}}<img src='$diagramURL' alt='$escapetool.xml($diagramTitle)'/>{{/html}}")
#end
Expand Down

0 comments on commit a30f2ee

Please sign in to comment.