[yelp-xsl] Fix up some handling of the style attr
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] Fix up some handling of the style attr
- Date: Tue, 29 Dec 2020 16:05:45 +0000 (UTC)
commit df34ef05ebe8942604628e6ecf892fc5f7db19c1
Author: Shaun McCance <shaunm redhat com>
Date: Tue Dec 29 11:05:34 2020 -0500
Fix up some handling of the style attr
xslt/mallard/html/mal2html-block.xsl | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index e9ba5f7c..0961d169 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -50,7 +50,7 @@ syntax highlighting support based on the `mime` attribute of $node, using
-->
<xsl:template name="mal2html.pre">
<xsl:param name="node" select="."/>
- <xsl:param name="numbered" select="contains(concat(' ', @style, ' '), 'numbered')"/>
+ <xsl:param name="numbered" select="contains(concat(' ', @style, ' '), ' numbered ')"/>
<xsl:variable name="if">
<xsl:call-template name="mal.if.test">
<xsl:with-param name="node" select="$node"/>
@@ -660,36 +660,37 @@ in accordance with the Mallard specification on fallback block content.
<!-- = note = -->
<xsl:template mode="mal2html.block.mode" match="mal:note">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
+ <xsl:variable name="style" select="concat(' ', @style, ' ')"/>
<xsl:variable name="notetitle">
<xsl:choose>
- <xsl:when test="contains(concat(' ', @style, ' '), ' advanced ')">
+ <xsl:when test="contains($style, ' advanced ')">
<xsl:text>Advanced</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' bug ')">
+ <xsl:when test="contains($style, ' bug ')">
<xsl:text>Bug</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' caution ')">
+ <xsl:when test="contains($style, ' caution ')">
<xsl:text>Caution</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' danger ')">
+ <xsl:when test="contains($style, ' danger ')">
<xsl:text>Danger</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' important ')">
+ <xsl:when test="contains($style, ' important ')">
<xsl:text>Important</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' package ')">
+ <xsl:when test="contains($style, ' package ')">
<xsl:text>Package</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' plain ')">
+ <xsl:when test="contains($style, ' plain ')">
<xsl:text>plain</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' sidebar ')">
+ <xsl:when test="contains($style, ' sidebar ')">
<xsl:text>Sidebar</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' tip ')">
+ <xsl:when test="contains($style, ' tip ')">
<xsl:text>Tip</xsl:text>
</xsl:when>
- <xsl:when test="contains(concat(' ', @style, ' '), ' warning ')">
+ <xsl:when test="contains($style, ' warning ')">
<xsl:text>Warning</xsl:text>
</xsl:when>
<xsl:otherwise>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]