doc: Remove language code from title

This code currently works only by assuming that the language code is either 2 or
5 chars long. This is not entirely correct but works for now.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati authored and James Valleroy committed 2019-10-30 19:24:54 -04:00
1 parent 46b587196f
commit d67412220a
1 file changed
+9 -2
+9 -2
View File
@@ -46,8 +46,15 @@
<xsl:param name="title"/>
<xsl:choose>
<xsl:when test="contains($title, '/')">
<xsl:value-of select="substring-before($title, '/')"/>
<xsl:text> </xsl:text>
<!-- Skip copying the language code -->
<xsl:choose>
<xsl:when test="not(string-length(substring-before($title, '/'))=2)
and
not(string-length(substring-before($title, '/'))=5 and contains(substring-before($title, '/'), '-'))">
<xsl:value-of select="substring-before($title, '/')"/>
<xsl:text> </xsl:text>
</xsl:when>
</xsl:choose>
<xsl:call-template name="clean-title">
<xsl:with-param name="title" select="substring-after($title, '/')"/>
</xsl:call-template>