diff options
author | 2020-02-25 17:23:46 +0100 | |
---|---|---|
committer | 2020-02-28 08:16:20 +0100 | |
commit | da089b016625ed6f9df3b122c1d972748f5cdb85 (patch) | |
tree | a7427277c542aabfabb1a006377ee5df0be555e1 /devbook.xsl | |
parent | devbook.xsl: Don't use @link to construct the home path. (diff) | |
download | devmanual-da089b016625ed6f9df3b122c1d972748f5cdb85.tar.gz devmanual-da089b016625ed6f9df3b122c1d972748f5cdb85.tar.bz2 devmanual-da089b016625ed6f9df3b122c1d972748f5cdb85.zip |
devbook.xsl: Suppress // in URIs with literal ## fragments.
Handle the slash in the same way as for other types of URIs.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'devbook.xsl')
-rw-r--r-- | devbook.xsl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/devbook.xsl b/devbook.xsl index 31c73d4..e3bb38d 100644 --- a/devbook.xsl +++ b/devbook.xsl @@ -301,7 +301,10 @@ </xsl:variable> <xsl:choose> <xsl:when test="contains(@link, '##')"> - <a class="{$class}" href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '##'), '::'), '/index.html#', substring-after(@link, '##'))}"><xsl:value-of select="."/></a> + <xsl:variable name="slash"> + <xsl:if test="substring(substring-before(@link, '##'), string-length(substring-before(@link, '##'))) != '/'">/</xsl:if> + </xsl:variable> + <a class="{$class}" href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '##'), '::'), $slash, 'index.html#', substring-after(@link, '##'))}"><xsl:value-of select="."/></a> </xsl:when> <xsl:when test="contains(@link, '#')"> <xsl:variable name="anchor"> |