<!-- * verbatim, presumably to support some kludge; I removed it -->
<xsl:when test="self::address|self::literallayout|self::programlisting|
self::screen|self::synopsis">
+ <xsl:text> </xsl:text>
<xsl:text>.sp </xsl:text>
<xsl:apply-templates select="."/>
</xsl:when>
<xsl:when test="self::text()">
<!-- * Check to see if this is a text node. -->
<!-- * -->
- <!-- * If so, take any multiple whitespace at the beginning or end of -->
- <!-- * it, and replace it with a space plus a linebreak. -->
+ <!-- * If so, replace all whitespace at the beginning or end of it -->
+ <!-- * with a single linebreak. -->
<!-- * -->
- <!-- * This hack results in some ugliness in the generated roff -->
- <!-- * source. But it ensures the whitespace around text nodes in mixed -->
- <!-- * content gets preserved; without the hack, that whitespace -->
- <!-- * effectively gets gobbled. -->
- <!-- * -->
- <!-- * Note if the node is just space, we just pass it through -->
- <!-- * without (re)adding a line break. -->
- <!-- * -->
- <!-- * There must be a better way to do with this... -->
<xsl:variable name="content">
<xsl:apply-templates select="."/>
</xsl:variable>
preceding-sibling::procedure[1]
)
">
- <xsl:text> </xsl:text>
+ <xsl:text> </xsl:text>
</xsl:if>
<xsl:value-of select="normalize-space($content)"/>
<xsl:if
test="translate(substring(., string-length(.), 1),'	 ',' ') = ' '
and following-sibling::node()[name(.)!='']
">
- <xsl:text> </xsl:text>
<xsl:if test="normalize-space($content) != ''">
<xsl:text> </xsl:text>
</xsl:if>
<!-- * now, we need to restore single-hypens in all roff requests -->
<!-- * (because the substitution above added backslashes before them) -->
<substitution oldstring=".sp \-" newstring=".sp -"/>
+ <substitution oldstring=".PP .sp" newstring=".PP"/>
<substitution oldstring=".it 1 an\-trap" newstring=".it 1 an-trap"/>
<substitution oldstring=".nr an\-no\-space\-flag 1" newstring=".nr an-no-space-flag 1"/>
<substitution oldstring=".nr an\-break\-flag 1" newstring=".nr an-break-flag 1"/>
<!-- * squeeze multiple newlines before a roff request -->
<substitution oldstring=" ." newstring=" ."/>
+ <!-- * remove any .sp occurences that directly follow a .PP -->
+ <substitution oldstring=".PP .sp" newstring=".PP"/>
<!-- * squeeze multiple newlines after start of no-fill (verbatim) env. -->
<substitution oldstring=".nf " newstring=".nf "/>
<!-- * an apostrophe at the beginning of a line gets interpreted as a -->