[Libreoffice-commits] help.git: help3xsl/get_url.xsl

Olivier Hallot olivier.hallot at libreoffice.org
Thu Jan 11 01:32:00 UTC 2018


 help3xsl/get_url.xsl |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 2575baa6d1f20327dc943b1cc73ff4252f6cbfe6
Author: Olivier Hallot <olivier.hallot at libreoffice.org>
Date:   Wed Jan 10 23:18:27 2018 -0200

    Fix HIDs with '?' inside
    
    '?' interferes in logic to extract HID
    
    Change-Id: I5252d1cf861959cc6ad2b49afe9b19f4c9698f56
    Reviewed-on: https://gerrit.libreoffice.org/47734
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
    Tested-by: Olivier Hallot <olivier.hallot at libreoffice.org>

diff --git a/help3xsl/get_url.xsl b/help3xsl/get_url.xsl
index 1cff5f954..f7a032749 100644
--- a/help3xsl/get_url.xsl
+++ b/help3xsl/get_url.xsl
@@ -45,17 +45,19 @@ xsltproc get_bookmark.xsl <file.xhp>
 //-->
 
 <!-- Extract the bookmarks branches x filename-->
+<!--Special case for questions marks chars, that interferes in passing
+parameters in URLS-->
 <xsl:template match="/">
     <xsl:variable name="href" select="concat(substring-before($filename,'xhp'),'html')"/>
     <xsl:for-each select="//bookmark[@branch!='index']">
-        <xsl:if test="not(contains(@branch,'/.uno'))">
-            <xsl:text>'</xsl:text>
-            <xsl:value-of select="substring-after(@branch,'hid/')"/>
-            <xsl:text>':'</xsl:text>
-            <xsl:value-of select="$href" /><xsl:text>',&#xA;</xsl:text>
-        </xsl:if>
+        <xsl:variable name="aux" select="substring-after(@branch,'hid/')"/>
+        <xsl:text>'</xsl:text>
+        <xsl:choose>
+            <xsl:when test="not(contains($aux,'?'))"><xsl:value-of select="$aux"/></xsl:when>
+            <xsl:otherwise><xsl:value-of select="concat(substring-before($aux,'?'),'%3F',substring-after($aux,'?'))"/></xsl:otherwise>
+        </xsl:choose>
+        <xsl:text>':'</xsl:text>
+        <xsl:value-of select="$href"/><xsl:text>',&#xA;</xsl:text>
     </xsl:for-each>
 </xsl:template>
-
-
 </xsl:stylesheet>


More information about the Libreoffice-commits mailing list