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 2019-10-13 21:21:55 +05:30 committed by James Valleroy
parent 46b587196f
commit d67412220a
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

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>