Handle superscript

This commit is contained in:
Carol (Nichols || Goulding) 2022-09-06 11:23:42 -04:00 committed by Carol (Nichols || Goulding)
parent b65ef142be
commit d1d0af3c08
2 changed files with 15 additions and 5 deletions

View File

@ -333,11 +333,11 @@ the sign matters, a number is shown with a plus sign or a minus sign; however,
when its safe to assume the number is positive, its shown with no sign.
Signed numbers are stored using twos complement representation.
Each signed variant can store numbers from -(2n - 1) to 2n - 1 - 1 inclusive,
where *n* is the number of bits that variant uses. So an `i8` can store numbers
from -(27) to 27 - 1, which equals -128 to 127. Unsigned variants can store
numbers from 0 to 2n - 1, so a `u8` can store numbers from 0 to 28 - 1, which
equals 0 to 255.
Each signed variant can store numbers from -(2<sup>n - 1</sup>) to 2<sup>n -
1</sup> - 1 inclusive, where *n* is the number of bits that variant uses. So an
`i8` can store numbers from -(2<sup>7</sup>) to 2<sup>7</sup> - 1, which equals
-128 to 127. Unsigned variants can store numbers from 0 to 2<sup>n</sup> - 1,
so a `u8` can store numbers from 0 to 2<sup>8</sup> - 1, which equals 0 to 255.
Additionally, the `isize` and `usize` types depend on the architecture of the
computer your program is running on, which is denoted in the table as “arch”:

View File

@ -333,6 +333,16 @@ Unmatched: <xsl:value-of select="w:pPr/w:pStyle/@w:val" />
</xsl:choose>
</xsl:template>
<xsl:template match="w:r[w:rPr/w:rStyle[@w:val = 'Superscript']]">
<xsl:if test="not(preceding-sibling::*[1][self::w:r]) or preceding-sibling::w:r[1][not(w:t) or not(w:rPr/w:rStyle/@w:val = 'Superscript')]">
<xsl:text>&lt;sup></xsl:text>
</xsl:if>
<xsl:value-of select="w:t" />
<xsl:if test="not(following-sibling::*[1][self::w:r]) or following-sibling::w:r[1][not(w:t) or not(w:rPr/w:rStyle/@w:val = 'Superscript')]">
<xsl:text>&lt;/sup></xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="w:r">
<xsl:value-of select="w:t" />
</xsl:template>