]> granicus.if.org Git - docbook-dsssl/commitdiff
Prevent a line beginning with a '.' character being interpreted as a
authorJoe Orton <jorton@redhat.com>
Sun, 5 Jan 2003 19:10:43 +0000 (19:10 +0000)
committerJoe Orton <jorton@redhat.com>
Sun, 5 Jan 2003 19:10:43 +0000 (19:10 +0000)
troff macro by inserting \& (a zero-width space) before every '.' in text.

xsl/manpages/docbook.xsl

index a2fe36fb30345beae7c6c7c2be3fbf7f89424407..ad831d4a5a450f1d1e8d12a35bfdedaa0805f7fb 100644 (file)
   </xsl:call-template>
 </xsl:template>
 
+<!-- if a period character is output at the beginning of a line
+  it will be interpreted as a groff macro, so prefix all periods
+  with "\&", a zero-width space. -->
+<xsl:template name="replace-period">
+  <xsl:param name="content" select="''"/>
+  <xsl:call-template name="replace-string">
+    <xsl:with-param name="content" select="$content"/>
+    <xsl:with-param name="replace" select="'.'"/>
+    <xsl:with-param name="with" select="'\&#38;.'"/>
+  </xsl:call-template>
+</xsl:template>
+
 <xsl:template name="replace-entities">
   <xsl:param name="content" select="''"/>
   <xsl:call-template name="replace-hellip">
             <xsl:with-param name="content">
               <xsl:call-template name="replace-setmn">
                 <xsl:with-param name="content">
-                 <xsl:call-template name="replace-backslash">
-                   <xsl:with-param name="content" select="$content"/>
+                 <xsl:call-template name="replace-period">
+                    <xsl:with-param name="content">
+                      <xsl:call-template name="replace-backslash">
+                       <xsl:with-param name="content" select="$content"/>
+                      </xsl:call-template>
+                    </xsl:with-param>
                  </xsl:call-template>
                 </xsl:with-param>
               </xsl:call-template>