From ea13417e8a752380faa453e2a4337aa13983fb3e Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Fri, 14 Jul 2017 14:37:54 +0200
Subject: [PATCH] Prohibit separate slide link when already in slide mode

---
 ws/Docbook/Preprocess/Xsl/docbook2html.xsl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ws/Docbook/Preprocess/Xsl/docbook2html.xsl b/ws/Docbook/Preprocess/Xsl/docbook2html.xsl
index f6f493a2d..473e121ad 100644
--- a/ws/Docbook/Preprocess/Xsl/docbook2html.xsl
+++ b/ws/Docbook/Preprocess/Xsl/docbook2html.xsl
@@ -27,11 +27,11 @@
   </xsl:template>
   
   <xsl:template match="db:figure/db:title">
+    <xsl:variable name="slideContainerId" select="ancestor::*[contains(@annotations, 'slide')]/@xml:id"/>
     
     <title>
       <xsl:copy-of select="text()|*"/>
 
-      <xsl:variable name="slideContainerId" select="ancestor::*[contains(@annotations, 'slide')]/@xml:id"/>
       <xsl:if test="$slideContainerId">
         <xsl:text> </xsl:text>
         
@@ -85,7 +85,7 @@
       </xsl:if>
     </title>
     
-    <xsl:if test="ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.fig')">
+    <xsl:if test="not($slideContainerId) and ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.fig')">
       <para>
         <uri>
           <xsl:attribute name="xlink:href">
@@ -104,7 +104,7 @@
       </para>
     </xsl:if>
     
-    <xsl:if test="ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.svg')">
+    <xsl:if test="not($slideContainerId) and ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.svg')">
       <para>
         <uri>
           <xsl:attribute name="xlink:href">
-- 
GitLab