Support existing uses of <div class="example">

This commit is contained in:
Jonas Schäfer 2019-04-04 18:36:38 +02:00
parent fc06bd46fd
commit 3f29a910da
2 changed files with 11 additions and 3 deletions

10
xep.xsl
View File

@ -1053,7 +1053,13 @@ content: "XEP-<xsl:value-of select='/xep/header/number'/>";
</xsl:template> </xsl:template>
<xsl:template match='div'> <xsl:template match='div'>
<div> <xsl:variable name='type'>
<xsl:choose>
<xsl:when test='@class = "example"'>figure</xsl:when>
<xsl:otherwise>div</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name='{$type}'>
<xsl:variable name='class.count' select='count(@class)'/> <xsl:variable name='class.count' select='count(@class)'/>
<xsl:if test='$class.count=1'> <xsl:if test='$class.count=1'>
<xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute> <xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute>
@ -1063,7 +1069,7 @@ content: "XEP-<xsl:value-of select='/xep/header/number'/>";
<xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute> <xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute>
</xsl:if> </xsl:if>
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </xsl:element>
</xsl:template> </xsl:template>
<xsl:template match='em'> <xsl:template match='em'>

View File

@ -1281,7 +1281,8 @@
} }
figure.code, figure.code,
figure.code-example { figure.code-example,
figure.example {
/* margin: 1.5em; */ /* margin: 1.5em; */
padding: 1.5em; padding: 1.5em;
border: 1px solid rgba(19, 181, 234, 1.0); border: 1px solid rgba(19, 181, 234, 1.0);
@ -1475,6 +1476,7 @@
nav#toc ol.toc li a:hover:before { nav#toc ol.toc li a:hover:before {
color: white; color: white;
} }
} }
@media screen and ( max-width: 60em ) { @media screen and ( max-width: 60em ) {