summaryrefslogtreecommitdiff
path: root/templates/katsomo.fi/description.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/katsomo.fi/description.xsl')
-rw-r--r--templates/katsomo.fi/description.xsl17
1 files changed, 13 insertions, 4 deletions
diff --git a/templates/katsomo.fi/description.xsl b/templates/katsomo.fi/description.xsl
index 59c313b..1a7d39b 100644
--- a/templates/katsomo.fi/description.xsl
+++ b/templates/katsomo.fi/description.xsl
@@ -12,18 +12,27 @@
<xsl:variable name="episodetitle">
<xsl:choose>
<xsl:when test="contains(/html/head/meta[@name='title']/@content, ' - Katsomo')">
- <xsl:value-of select="substring-before(/html/head/meta[@name='title']/@content, ' - Katsomo')"/>
+ <xsl:value-of select="normalize-space(substring-before(/html/head/meta[@name='title']/@content, ' - Katsomo'))"/>
</xsl:when>
<xsl:when test="contains(/html/head/meta[@name='title']/@content, ' - MTV3 Katsomo')">
- <xsl:value-of select="substring-before(/html/head/meta[@name='title']/@content, ' - MTV3 Katsomo')"/>
+ <xsl:value-of select="normalize-space(substring-before(/html/head/meta[@name='title']/@content, ' - MTV3 Katsomo'))"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="/html/head/meta[@name='title']/@content"/>
+ <xsl:value-of select="normalize-space(/html/head/meta[@name='title']/@content)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
-<xsl:variable name="title" select="normalize-space(concat(id('program_content')/h1, ' ', $episodetitle))"/>
+<xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="normalize-space(id('program_content')/h1) = $episodetitle">
+ <xsl:value-of select="$episodetitle"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="normalize-space(concat(id('program_content')/h1, ': ', $episodetitle))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
<xsl:variable name="pid" select="substring-after($docurl, 'progId=')"/>