[library-web] fix image source links in imported documents



commit 405c436bd8199c7ad390ab100ee496d4b4da8df5
Author: Frédéric Péters <fpeters 0d be>
Date:   Thu Jan 30 14:32:33 2014 +0000

    fix image source links in imported documents

 data/xslt/html2html.xsl |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/data/xslt/html2html.xsl b/data/xslt/html2html.xsl
index e82ce3f..3089081 100644
--- a/data/xslt/html2html.xsl
+++ b/data/xslt/html2html.xsl
@@ -283,6 +283,19 @@ along with libgo; if not, write to the Free Software Foundation, Inc.,
    </xsl:attribute>
   </xsl:template>
 
+  <xsl:template match="@src">
+   <xsl:attribute name="src">
+    <xsl:choose>
+     <xsl:when test="starts-with(., '/') and $libgo.rewritebase">
+       <xsl:value-of select="concat($libgo.rewritebase, .)"/>
+     </xsl:when>
+     <xsl:otherwise>
+       <xsl:value-of select="."/>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:attribute>
+  </xsl:template>
+
   <xsl:template match="meta[ content='text/html; charset=US-ASCII']">
   </xsl:template>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]