aboutsummaryrefslogtreecommitdiff
path: root/utility
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-05-15 23:19:57 +0200
committerAdrian Kummerlaender2016-05-15 23:19:57 +0200
commit72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca (patch)
tree7720ba61546ae0037f96d319a866f2e01a43cd36 /utility
parentbb4b5ef78b8070662b65749ffb7284e8e2350d62 (diff)
downloadblog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.gz
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.bz2
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.lz
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.xz
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.zst
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.zip
Implement support for inline math expressions
Diffstat (limited to 'utility')
-rw-r--r--utility/formatter.xsl23
1 files changed, 17 insertions, 6 deletions
diff --git a/utility/formatter.xsl b/utility/formatter.xsl
index 21cdff4..7b9292c 100644
--- a/utility/formatter.xsl
+++ b/utility/formatter.xsl
@@ -30,9 +30,7 @@
</xsl:call-template>
</xsl:variable>
- <p class="math">
- <xsl:copy-of select="xalan:nodeset($formatted_expression)/node()"/>
- </p>
+ <xsl:copy-of select="xalan:nodeset($formatted_expression)/*"/>
</xsl:template>
<xsl:template name="code_highlighter">
@@ -89,9 +87,22 @@
</xsl:template>
<xsl:template match="script" mode="embellish">
- <xsl:call-template name="math_highlighter">
- <xsl:with-param name="source" select="text()"/>
- </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="contains(@type, 'mode=display')">
+ <p class="math">
+ <xsl:call-template name="math_highlighter">
+ <xsl:with-param name="source" select="text()"/>
+ </xsl:call-template>
+ </p>
+ </xsl:when>
+ <xsl:otherwise>
+ <span class="math">
+ <xsl:call-template name="math_highlighter">
+ <xsl:with-param name="source" select="text()"/>
+ </xsl:call-template>
+ </span>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template name="formatter">