]> granicus.if.org Git - docbook-dsssl/commitdiff
Reverted necessary escaping of backslash, dot, and dash
authorMichael Smith <xmldoc@users.sourceforge.net>
Mon, 26 Feb 2007 20:04:25 +0000 (20:04 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Mon, 26 Feb 2007 20:04:25 +0000 (20:04 +0000)
out of the well-intentioned (but it now appears,
misguided) "marker" mechanism (introduced in the 1.72.0
release) -- which made use of alternative "marker"
characters as internal representations of those
characters, and then replaced them just prior to
serialization -- and back into what's basically the
system that was used prior to the 1.69.0 release; that
is, into a part of stylesheet code that gets executed
at the beginning of processing -- before any other roff
markup up is. This change obviates the need for the
marker system. It also requires a lot less RAM during
processing (for large files, the marker mechanism
ending up requiring gigabytes of memory).

Closes bug #1661177. Thanks to Scott Smedley for
providing a test case (the fvwm man page) that exposed
the problem with the marker mechanism.

Also moved the mechanism for converting non-breaking
spaces back into the same area of the stylesheet code.

xsl/manpages/block.xsl
xsl/manpages/endnotes.xsl
xsl/manpages/info.xsl
xsl/manpages/lists.xsl
xsl/manpages/other.xsl
xsl/manpages/refentry.xsl
xsl/manpages/synop.xsl
xsl/manpages/table.xsl
xsl/manpages/utility.xsl
xsl/params/man.string.subst.map.xml

index 1751a45286185ba0e0952cc95ff20c50824f7c7e..43917f6ff068339905fea632f889c91f0259400f 100644 (file)
@@ -26,7 +26,7 @@
   <xsl:variable name="title.wrapper">
     <bold><xsl:value-of select="normalize-space(title[1])"/></bold>
   </xsl:variable>
-  <xsl:text>&#x2302;PP&#10;</xsl:text>
+  <xsl:text>.PP&#10;</xsl:text>
   <!-- * don't put linebreak after head; instead render it as a "run in" -->
   <!-- * head, that is, inline, with a period and space following it -->
   <xsl:apply-templates mode="bold" select="exsl:node-set($title.wrapper)"/>
                     ancestor::authorblurb or
                     ancestor::personblurb">
       <xsl:if test="preceding-sibling::*[not(name() ='')]">
-        <xsl:text>&#x2302;sp</xsl:text>
+        <xsl:text>.sp</xsl:text>
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;RS 4n</xsl:text>
+        <xsl:text>.RS 4n</xsl:text>
         <xsl:text>&#10;</xsl:text>
       </xsl:if>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:text>&#x2302;PP</xsl:text>
+      <xsl:text>.PP</xsl:text>
       <xsl:text>&#10;</xsl:text>
     </xsl:otherwise>
   </xsl:choose>
@@ -72,7 +72,7 @@
                   ancestor::personblurb">
       <xsl:if test="preceding-sibling::*[not(name() ='')]">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;RE</xsl:text>
+        <xsl:text>.RE</xsl:text>
         <xsl:text>&#10;</xsl:text>
       </xsl:if>
     </xsl:if>
@@ -87,7 +87,7 @@
   <xsl:text>&#10;</xsl:text>
   <xsl:if test="not(ancestor::authorblurb) and
                 not(ancestor::personblurb)">
-    <xsl:text>&#x2302;sp&#10;</xsl:text>
+    <xsl:text>.sp&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
                     parent::td|parent::th" /> <!-- do nothing -->
     <xsl:otherwise>
       <xsl:text>&#10;</xsl:text>
-      <xsl:text>&#x2302;sp&#10;</xsl:text>
+      <xsl:text>.sp&#10;</xsl:text>
     </xsl:otherwise>
   </xsl:choose>
   <xsl:if test="$indent = 'Yes'">
     <!-- * start indented section -->
-    <xsl:text>&#x2302;RS</xsl:text> 
+    <xsl:text>.RS</xsl:text> 
     <xsl:if test="not($man.indent.width = '')">
       <xsl:text> </xsl:text>
       <xsl:value-of select="$man.indent.width"/>
       <!-- * default to be non-bold - because it's a convention that's -->
       <!-- * followed is the vast majority of existing man pages that document -->
       <!-- * functions, and we need to follow it by default, like it or no. -->
-      <xsl:text>&#x2302;ft </xsl:text>
+      <xsl:text>.ft </xsl:text>
       <xsl:value-of select="$man.font.funcsynopsisinfo"/>
       <xsl:text>&#10;</xsl:text>
-      <xsl:text>&#x2302;nf&#10;</xsl:text>
+      <xsl:text>.nf&#10;</xsl:text>
       <xsl:apply-templates/>
       <xsl:text>&#10;</xsl:text>
-      <xsl:text>&#x2302;fi&#10;</xsl:text>
-      <xsl:text>&#x2302;ft&#10;</xsl:text>
+      <xsl:text>.fi&#10;</xsl:text>
+      <xsl:text>.ft&#10;</xsl:text>
     </xsl:when>
     <xsl:otherwise>
       <!-- * Other verbatims do not need to get bolded -->
-      <xsl:text>&#x2302;nf&#10;</xsl:text>
+      <xsl:text>.nf&#10;</xsl:text>
       <xsl:apply-templates/>
       <xsl:text>&#10;</xsl:text>
-      <xsl:text>&#x2302;fi&#10;</xsl:text>
+      <xsl:text>.fi&#10;</xsl:text>
     </xsl:otherwise>
   </xsl:choose>
   <xsl:if test="$indent = 'Yes'">
     <!-- * end indented section -->
-    <xsl:text>&#x2302;RE&#10;</xsl:text> 
+    <xsl:text>.RE&#10;</xsl:text> 
   </xsl:if>
   <!-- * if first following sibling node of this verbatim -->
   <!-- * environment is a text node, output a line of space before it -->
   <xsl:if test="following-sibling::node()[1][name(.) = '']">
-    <xsl:text>&#x2302;sp&#10;</xsl:text>
+    <xsl:text>.sp&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:text>&#x2302;PP&#10;</xsl:text>
+  <xsl:text>.PP&#10;</xsl:text>
   <xsl:call-template name="formal.object">
     <xsl:with-param name="placement" select="$placement"/>
   </xsl:call-template>
 <!-- ==================================================================== -->
 
 <xsl:template match="mediaobject">
-  <xsl:text>&#x2302;sp</xsl:text>
+  <xsl:text>.sp</xsl:text>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;RS</xsl:text> 
+  <xsl:text>.RS</xsl:text> 
   <xsl:if test="not($list-indent = '')">
     <xsl:text> </xsl:text>
     <xsl:value-of select="$list-indent"/>
   <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates/>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;RE&#10;</xsl:text>
+  <xsl:text>.RE&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="imageobject">
index f0bad20011b0c5d4d24ebd6d17aecd72073be9cc..39a2f81a2737518530121555fb6fcd655d11c8d6 100644 (file)
         <xsl:if test="$man.hyphenate.urls = 0 and
                       $man.break.after.slash = 0">
           <xsl:call-template name="suppress.hyphenation"/>
-          <xsl:text>&#x2593;%</xsl:text>
+          <xsl:text>\%</xsl:text>
         </xsl:if>
         <xsl:value-of select="$earmark"/>
       </xsl:otherwise>
     <!-- * This formatting should probably be made user-configurable, -->
     <!-- * to allow something other than just square brackets; e.g., -->
     <!-- * Angle brackets<10> or Braces{10}  -->
-    <xsl:text>&#x2593;&amp;[</xsl:text>
+    <xsl:text>\&amp;[</xsl:text>
     <xsl:value-of select="$notesource.number"/>
     <xsl:text>]</xsl:text>
     <!-- * Note that the reason for the \& before the opening bracket -->
   <xsl:call-template name="mark.subheading"/>
 
   <!-- * ======= make the endnotes-list section heading ============= -->
-  <xsl:text>&#x2302;SH "</xsl:text>
+  <xsl:text>.SH "</xsl:text>
   <xsl:call-template name="string.upper">
     <xsl:with-param name="string">
       <xsl:choose>
   <xsl:for-each select="$endnotes/earmark">
     <!-- * make paragraph with hanging indent, and starting with a -->
     <!-- * number in the form " 1." (padded to $man.indent.width - 1) -->
-    <xsl:text>&#x2302;IP</xsl:text>
+    <xsl:text>.IP</xsl:text>
     <xsl:text> "</xsl:text>
     <xsl:variable name="endnote.number">
       <xsl:value-of select="@number"/>
     <!-- * content and a uri attribute; so we check for that -->
     <!-- * condition here. -->
     <xsl:if test="*/node() and @uri">
-      <xsl:text>&#x2302;RS</xsl:text>
+      <xsl:text>.RS</xsl:text>
       <xsl:if test="not($list-indent = '')">
         <xsl:text> </xsl:text>
         <xsl:value-of select="$list-indent"/>
       <xsl:if test="$man.hyphenate.urls = 0
                     and $man.break.after.slash = 0">
         <xsl:call-template name="suppress.hyphenation"/>
-        <xsl:text>&#x2593;%</xsl:text>
+        <xsl:text>\%</xsl:text>
       </xsl:if>
       <xsl:value-of select="@uri"/>
       <xsl:text>&#10;</xsl:text>
-      <xsl:text>&#x2302;RE</xsl:text>
+      <xsl:text>.RE</xsl:text>
       <xsl:text>&#10;</xsl:text>
     </xsl:if>
 
index 66cd06cdd5ab8152fd6a5b709e1b3a47e30f7381..5bbe063f60fc9560a3730fae7f0add082de6540b 100644 (file)
@@ -25,7 +25,7 @@
         <!-- * preserving the original default indent value -->
         <!-- * when $man.indent.refsect is non-zero; -->
         <!-- * "u" is a roff unit specifier -->
-        <xsl:text>&#x2593;n(zqu</xsl:text>
+        <xsl:text>\n(zqu</xsl:text>
       </xsl:when>
       <xsl:otherwise/> <!-- * otherwise, just leave it empty -->
     </xsl:choose>
                       $info//othercredit)">
           </xsl:value-of>
         </xsl:variable>
-        <xsl:text>&#x2302;SH "</xsl:text>
+        <xsl:text>.SH "</xsl:text>
         <xsl:call-template name="make.authorsecttitle">
           <xsl:with-param name="authorcount" select="$authorcount"/>
         </xsl:call-template>
         <xsl:variable name="person-name-node">
           <bold><xsl:value-of select="$person-name"/></bold>
         </xsl:variable>
-        <xsl:text>&#x2302;PP&#10;</xsl:text>
+        <xsl:text>.PP&#10;</xsl:text>
         <!-- * Display person name in bold -->
         <xsl:apply-templates mode="bold" select="exsl:node-set($person-name-node)"/>
         <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
         <xsl:text>&#10;</xsl:text>
       </xsl:when>
       <xsl:otherwise>
-        <xsl:text>&#x2302;br&#10;</xsl:text>
+        <xsl:text>.br&#10;</xsl:text>
       </xsl:otherwise>
     </xsl:choose>
     <!-- * Display affiliation(s) on separate lines -->
   </xsl:template>
 
   <xsl:template match="collab" mode="authorsect">
-    <xsl:text>&#x2302;PP&#10;</xsl:text>
+    <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="collabname"/>
     <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
     <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
   </xsl:template>
 
   <xsl:template match="corpauthor|corpcredit|orgname|publishername" mode="authorsect">
-    <xsl:text>&#x2302;PP&#10;</xsl:text>
+    <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="."/>
     <xsl:text>&#10;</xsl:text>
     <xsl:if test="self::publishername">
   </xsl:template>
 
   <xsl:template match="publisher" mode="authorsect">
-    <xsl:text>&#x2302;PP&#10;</xsl:text>
+    <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="publishername"/>
     <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
     <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
 
   <xsl:template name="publisher.attribution">
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
-    <xsl:text>&#x2302;IP ""</xsl:text> 
+    <xsl:text>.sp -1n&#10;</xsl:text>
+    <xsl:text>.IP ""</xsl:text> 
     <xsl:if test="not($blurb-indent = '')">
       <xsl:text> </xsl:text>
       <xsl:value-of select="$blurb-indent"/>
     <!-- * angle bracket and before the closing angle bracket is to -->
     <!-- * prevent groff from inserting a linebreak at those points and -->
     <!-- * outputting a hyphen character where the break occurs -->
-    <xsl:text>&lt;&#x2593;&amp;</xsl:text>
+    <xsl:text>&lt;\&amp;</xsl:text>
     <xsl:choose>
       <xsl:when test="self::email">
         <xsl:variable name="contents">
         <xsl:value-of select="normalize-space($contents)"/>
       </xsl:when>
     </xsl:choose>
-    <xsl:text>&#x2593;&amp;&gt;</xsl:text>
+    <xsl:text>\&amp;&gt;</xsl:text>
     <xsl:choose>
       <xsl:when test="not(following-sibling::*[descendant-or-self::email]
                       or following-sibling::address/otheraddr/ulink
     <!-- * If contents are actually empty except for an email address -->
     <!-- * or ulink, then output nothing. -->
     <xsl:if test="$contents != ''">
-      <xsl:text>&#x2302;br&#10;</xsl:text>
+      <xsl:text>.br&#10;</xsl:text>
       <xsl:for-each select="shortaffil|jobtitle|orgname|orgdiv|address">
         <!-- * only display output of nodes other than email or ulink -->
         <xsl:apply-templates select="node()[not(self::email) and not(self::otheraddr/ulink)]"/>
         <xsl:otherwise>
           <!-- * put a line break after every Affiliation instance except -->
           <!-- * the last one in the set -->
-          <xsl:text>&#x2302;br&#10;</xsl:text>
+          <xsl:text>.br&#10;</xsl:text>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:if>
     <!-- * an email address or ulink, then output nothing. -->
     <xsl:if test="$contents != ''">
       <xsl:text>&#10;</xsl:text>
-      <xsl:text>&#x2302;br&#10;</xsl:text>
+      <xsl:text>.br&#10;</xsl:text>
       <!--* Skip email and ulink descendants of Address (rendered elsewhere) -->
       <xsl:apply-templates select="node()[not(self::email) and not(self::otheraddr/ulink)]"/>
     </xsl:if>
       <!-- * Editor, then render the corresponding localized gentext -->
       <xsl:when test="self::author">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
-        <xsl:text>&#x2302;IP ""</xsl:text> 
+        <xsl:text>.sp -1n&#10;</xsl:text>
+        <xsl:text>.IP ""</xsl:text> 
         <xsl:if test="not($blurb-indent = '')">
           <xsl:text> </xsl:text>
           <xsl:value-of select="$blurb-indent"/>
       </xsl:when>
       <xsl:when test="self::editor">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
-        <xsl:text>&#x2302;IP ""</xsl:text> 
+        <xsl:text>.sp -1n&#10;</xsl:text>
+        <xsl:text>.IP ""</xsl:text> 
         <xsl:if test="not($blurb-indent = '')">
           <xsl:text> </xsl:text>
           <xsl:value-of select="$blurb-indent"/>
         <xsl:choose>
           <xsl:when test="@class and @class != 'other'">
             <xsl:text>&#10;</xsl:text>
-            <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
-            <xsl:text>&#x2302;IP ""</xsl:text> 
+            <xsl:text>.sp -1n&#10;</xsl:text>
+            <xsl:text>.IP ""</xsl:text> 
             <xsl:if test="not($blurb-indent = '')">
               <xsl:text> </xsl:text>
               <xsl:value-of select="$blurb-indent"/>
                 |../othername|../lineage|../honorific
                 |../affiliation|../email|../address">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
-        <xsl:text>&#x2302;IP ""</xsl:text> 
+        <xsl:text>.sp -1n&#10;</xsl:text>
+        <xsl:text>.IP ""</xsl:text> 
         <xsl:if test="not($blurb-indent = '')">
           <xsl:text> </xsl:text>
           <xsl:value-of select="$blurb-indent"/>
           <xsl:when test="not(preceding-sibling::*)">
             <!-- * if this *blurb or contrib has no preceding -->
             <!-- * siblings, then we need to start a new paragraph -->
-            <xsl:text>&#x2302;PP</xsl:text>
+            <xsl:text>.PP</xsl:text>
           </xsl:when>
           <xsl:otherwise>
             <!-- * otherwise, this has no preceding siblings, so -->
             <!-- * just put a linebreak -->
-            <xsl:text>&#x2302;br</xsl:text>
+            <xsl:text>.br</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:otherwise>
     <xsl:param name="info"/>
     <xsl:choose>
       <xsl:when test="$info//copyright|$info//legalnotice">
-        <xsl:text>&#x2302;SH "</xsl:text>
+        <xsl:text>.SH "</xsl:text>
         <xsl:call-template name="string.upper">
           <xsl:with-param name="string">
             <xsl:call-template name="gentext">
           </xsl:variable>
           <xsl:value-of select="normalize-space($contents)"/>
           <xsl:text>&#10;</xsl:text>
-          <xsl:text>&#x2302;br&#10;</xsl:text>
+          <xsl:text>.br&#10;</xsl:text>
         </xsl:for-each>
         <xsl:text>&#10;</xsl:text>
         <xsl:for-each select="(($info[//legalnotice])[last()]//legalnotice)">
           <xsl:apply-templates select="." mode="titlepage.mode"/>
           <xsl:text>&#10;</xsl:text>
-          <xsl:text>&#x2302;br&#10;</xsl:text>
+          <xsl:text>.br&#10;</xsl:text>
         </xsl:for-each>
       </xsl:when>
       <xsl:otherwise/> <!-- * do nothing, no copyright or legalnotice found -->
index 510dad94d9c866df94d7296c77affeeaf0ebe4c2..6b4fabcd54be5f3197564caf5feeca6670e982dd 100644 (file)
@@ -22,7 +22,7 @@
       <!-- * preserving the original default indent value -->
       <!-- * when $man.indent.refsect is non-zero; -->
       <!-- * "u" is a roff unit specifier -->
-      <xsl:text>&#x2593;n(zqu</xsl:text>
+      <xsl:text>\n(zqu</xsl:text>
     </xsl:when>
     <xsl:otherwise/> <!-- * otherwise, just leave it empty -->
   </xsl:choose>
                 ]">
     <!-- * Make sure multiple paragraphs within a list item don't -->
     <!-- * merge together.                                        -->
-    <xsl:text>&#x2302;sp&#10;</xsl:text>
+    <xsl:text>.sp&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
 <xsl:template match="variablelist|glosslist">
   <xsl:if test="title">
-    <xsl:text>&#x2302;PP&#10;</xsl:text>
+    <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="title"/>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
@@ -56,7 +56,7 @@
 </xsl:template>
 
 <xsl:template match="varlistentry|glossentry">
-  <xsl:text>&#x2302;PP&#10;</xsl:text> 
+  <xsl:text>.PP&#10;</xsl:text> 
   <xsl:for-each select="term|glossterm">
     <xsl:variable name="content">
       <xsl:apply-templates/>
         <xsl:value-of select="$variablelist.term.separator"/>
         <xsl:if test="not($variablelist.term.break.after = '0')">
           <xsl:text>&#10;</xsl:text>
-          <xsl:text>&#x2302;br&#10;</xsl:text>
+          <xsl:text>.br&#10;</xsl:text>
         </xsl:if>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:for-each>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;RS</xsl:text> 
+  <xsl:text>.RS</xsl:text> 
   <xsl:if test="not($list-indent = '')">
     <xsl:text> </xsl:text>
     <xsl:value-of select="$list-indent"/>
   </xsl:if>
   <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates/>
-  <xsl:text>&#x2302;RE&#10;</xsl:text>
+  <xsl:text>.RE&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="varlistentry/term"/>
                 parent::para[following-sibling::node()] or
                 parent::simpara[following-sibling::node()] or
                 parent::remark[following-sibling::node()]">
-    <xsl:text>&#x2302;sp</xsl:text> 
+    <xsl:text>.sp</xsl:text> 
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
   <!-- * processing before final output, the character-map will -->
   <!-- * handle conversion of the &#x2022; to "\(bu" for us -->
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;sp</xsl:text>
+  <xsl:text>.sp</xsl:text>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;RS</xsl:text>
+  <xsl:text>.RS</xsl:text>
   <xsl:if test="not($list-indent = '')">
     <xsl:text> </xsl:text>
     <xsl:value-of select="$list-indent"/>
   </xsl:if>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2593;h'&#x2591;</xsl:text>
+  <xsl:text>\h'-</xsl:text>
     <xsl:if test="not($list-indent = '')">
     <xsl:text>0</xsl:text>
     <xsl:value-of select="$list-indent"/>
   </xsl:if>
   <xsl:text>'</xsl:text>
   <xsl:text>&#x2022;</xsl:text>
-  <xsl:text>&#x2593;h'+</xsl:text>
+  <xsl:text>\h'+</xsl:text>
     <xsl:if test="not($list-indent = '')">
     <xsl:text>0</xsl:text>
     <xsl:value-of select="$list-indent - 1"/>
   <xsl:text>'</xsl:text>
   </xsl:if>
   <xsl:apply-templates/>
-  <xsl:text>&#x2302;RE&#10;</xsl:text>
+  <xsl:text>.RE&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="orderedlist/listitem|procedure/step">
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;sp</xsl:text>
+  <xsl:text>.sp</xsl:text>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;RS</xsl:text>
+  <xsl:text>.RS</xsl:text>
   <xsl:if test="not($list-indent = '')">
     <xsl:text> </xsl:text>
     <xsl:value-of select="$list-indent"/>
   </xsl:if>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2593;h'&#x2591;</xsl:text>
+  <xsl:text>\h'-</xsl:text>
     <xsl:if test="not($list-indent = '')">
     <xsl:text>0</xsl:text>
     <xsl:value-of select="$list-indent"/>
     <xsl:text> </xsl:text>
   </xsl:if>
   <xsl:number format="1."/>
-  <xsl:text>&#x2593;h'+</xsl:text>
+  <xsl:text>\h'+</xsl:text>
     <xsl:if test="not($list-indent = '')">
     <xsl:text>0</xsl:text>
     <xsl:value-of select="$list-indent - 2"/>
   <xsl:text>'</xsl:text>
   </xsl:if>
   <xsl:apply-templates/>
-  <xsl:text>&#x2302;RE&#10;</xsl:text>
+  <xsl:text>.RE&#10;</xsl:text>
   <xsl:text>&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="itemizedlist|orderedlist|procedure">
   <xsl:if test="title">
-    <xsl:text>&#x2302;PP&#10;</xsl:text>
+    <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="title"/>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
   <!-- * it, within the same para, then add a blank line and move -->
   <!-- * the left margin back to where it was -->
   <xsl:if test="parent::para and following-sibling::node()">
-    <xsl:text>&#x2302;sp&#10;</xsl:text>
-    <xsl:text>&#x2302;RE&#10;</xsl:text>
+    <xsl:text>.sp&#10;</xsl:text>
+    <xsl:text>.RE&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
                     orderedlist[ancestor::listitem or ancestor::step or ancestor::glossdef]|
                      procedure[ancestor::listitem or ancestor::step or ancestor::glossdef]">
   <xsl:if test="title">
-    <xsl:text>&#x2302;PP&#10;</xsl:text>
+    <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="title"/>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
                 parent::para[following-sibling::node()] or
                 parent::simpara[following-sibling::node()] or
                 parent::remark[following-sibling::node()]">
-    <xsl:text>&#x2302;IP ""</xsl:text> 
+    <xsl:text>.IP ""</xsl:text> 
     <xsl:if test="not($list-indent = '')">
       <xsl:text> </xsl:text>
       <xsl:value-of select="$list-indent"/>
 <!-- * list (ignoring the values of the type and columns attributes) -->
 <xsl:template match="simplelist">
   <xsl:for-each select="member">
-    <xsl:text>&#x2302;IP ""</xsl:text> 
+    <xsl:text>.IP ""</xsl:text> 
     <xsl:if test="not($list-indent = '')">
       <xsl:text> </xsl:text>
       <xsl:value-of select="$list-indent"/>
 <!-- * is no option for outputting it in manpages in "list" form. -->
 <xsl:template match="segmentedlist">
   <xsl:if test="title">
-    <xsl:text>&#x2302;PP&#10;</xsl:text>
+    <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="title"/>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
-  <xsl:text>&#x2302;&#x2593;" line length increase to cope w/ tbl weirdness&#10;</xsl:text>
-  <xsl:text>&#x2302;ll +(&#x2593;n(LLu * 62u / 100u)&#10;</xsl:text>
+  <xsl:text>.\" line length increase to cope w/ tbl weirdness&#10;</xsl:text>
+  <xsl:text>.ll +(\n(LLu * 62u / 100u)&#10;</xsl:text>
   <!-- * .TS = "Table Start" -->
-  <xsl:text>&#x2302;TS&#10;</xsl:text>
+  <xsl:text>.TS&#10;</xsl:text>
     <!-- * first output the table "format" spec, which tells tbl(1) how -->
     <!-- * how to format each row and column. -->
   <xsl:for-each select=".//segtitle">
     <xsl:text>l</xsl:text>
   </xsl:for-each>
   <!-- * last line of table format section must end with a dot -->
-  <xsl:text>&#x2302;&#10;</xsl:text>
+  <xsl:text>.&#10;</xsl:text>
   <!-- * optionally suppress output of segtitle -->
   <xsl:choose>
     <xsl:when test="$man.segtitle.suppress != 0">
   </xsl:choose>
   <xsl:apply-templates/>
   <!-- * .TE = "Table End" -->
-  <xsl:text>&#x2302;TE&#10;</xsl:text>
-  <xsl:text>&#x2302;&#x2593;" line length decrease back to previous value&#10;</xsl:text>
-  <xsl:text>&#x2302;ll &#x2591;(&#x2593;n(LLu * 62u / 100u)&#10;</xsl:text>
+  <xsl:text>.TE&#10;</xsl:text>
+  <xsl:text>.\" line length decrease back to previous value&#10;</xsl:text>
+  <xsl:text>.ll -(\n(LLu * 62u / 100u)&#10;</xsl:text>
   <!-- * put a blank line of space below the table -->
-  <xsl:text>&#x2302;sp&#10;</xsl:text>
+  <xsl:text>.sp&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="segmentedlist/segtitle" mode="table-title">
index 90c191eb3304504fa8cca74e5f10c42015d55ec1..0b96f09cbd24e842717d7babec2366392e3bc88b 100644 (file)
@@ -145,7 +145,7 @@ db:manvolnum
   <xsl:param name="refname"/>
   <!-- redefine this any way you'd like to output messages -->
   <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
-  <!--
+  <!-- Example:
   <xsl:if test="//footnote">
     <xsl:call-template name="log.message">
       <xsl:with-param name="level">Warn</xsl:with-param>
@@ -158,6 +158,117 @@ db:manvolnum
   -->
 </xsl:template>
 
+<!-- ==================================================================== -->
+<!-- * Escape roff special chars -->
+<!-- ==================================================================== -->
+
+<!-- ******************************************************************** -->
+<!-- *  -->
+<!-- * The backslash, dot, dash, and apostrophe (\, ., -, ') characters -->
+<!-- * have special meaning for roff, so before we do any other -->
+<!-- * processing, we must escape those characters where they appear in -->
+<!-- * the source content. -->
+<!-- *  -->
+<!-- * Here we also deal with replacing U+00a0 (non-breaking space) with -->
+<!-- * its roff equivalent -->
+<!-- *  -->
+<!-- ******************************************************************** -->
+
+<xsl:template match="//refentry//text()">
+  <xsl:call-template name="escape.roff.specials">
+    <xsl:with-param name="content">
+      <xsl:value-of select="."/>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="escape.roff.specials">
+  <xsl:param name="content"/>
+  <xsl:call-template name="convert.nobreak-space">
+    <xsl:with-param name="content">
+      <xsl:call-template name="escape.apostrophe">
+        <xsl:with-param name="content">
+          <xsl:call-template name="escape.dash">
+            <xsl:with-param name="content">
+              <xsl:call-template name="escape.dot">
+                <xsl:with-param name="content">
+                  <xsl:call-template name="escape.backslash">
+                    <xsl:with-param name="content" select="$content"/>
+                  </xsl:call-template>
+                </xsl:with-param>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="escape.backslash">
+  <xsl:param name="content"/>
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string" select="$content"/>
+    <xsl:with-param name="target">\</xsl:with-param>
+    <!-- * we use "\e" instead of "\\" because the groff docs say -->
+    <!-- * that's the correct thing to do; also because testing -->
+    <!-- * shows that "\\" doesn't always work as expected; for -->
+    <!-- * example, "\\" within a table seems to mess things up -->
+    <xsl:with-param name="replacement">\e</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="escape.dot">
+  <xsl:param name="content"/>
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string" select="$content"/>
+    <xsl:with-param name="target">.</xsl:with-param>
+    <xsl:with-param name="replacement">\.</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="escape.dash">
+  <xsl:param name="content"/>
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string" select="$content"/>
+    <xsl:with-param name="target">-</xsl:with-param>
+    <xsl:with-param name="replacement">\-</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="escape.apostrophe">
+  <xsl:param name="content"/>
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string" select="$content"/>
+    <xsl:with-param name="target">'</xsl:with-param>
+    <xsl:with-param name="replacement">\'</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="convert.nobreak-space">
+  <xsl:param name="content"/>
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string" select="$content"/>
+    <xsl:with-param name="target">&#x00a0;</xsl:with-param>
+    <!-- * A no-break space can be written two ways in roff; the -->
+    <!-- * difference, according to the "Page Motions" node in the -->
+    <!-- * groff info page, is: -->
+    <!-- *  -->
+    <!-- *   "\ " = -->
+    <!-- *   An unbreakable and unpaddable (i.e. not expanded -->
+    <!-- *   during filling) space. -->
+    <!-- *  -->
+    <!-- *   "\~" = -->
+    <!-- *   An unbreakable space that stretches like a normal -->
+    <!-- *   inter-word space when a line is adjusted."  -->
+    <!-- *  -->
+    <!-- * Unfortunately, roff seems to do some weird things with -->
+    <!-- * long lines that only have words separated by "\~" -->
+    <!-- * spaces, so it's safer just to stick with the "\ " space -->
+    <xsl:with-param name="replacement">\ </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
 <!-- ==================================================================== -->
 
 <!-- * top.comment generates a comment containing metadata for the man -->
@@ -169,12 +280,12 @@ db:manvolnum
     <xsl:param name="title"/>
     <xsl:param name="manual"/>
     <xsl:param name="source"/>
-    <xsl:text>&#x2302;&#x2593;"     Title: </xsl:text>
+    <xsl:text>.\"     Title: </xsl:text>
     <xsl:call-template name="replace.dots.and.dashes">
       <xsl:with-param name="content" select="$title"/>
     </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;&#x2593;"    Author: </xsl:text>
+    <xsl:text>.\"    Author: </xsl:text>
     <xsl:call-template name="replace.dots.and.dashes">
       <xsl:with-param name="content">
         <xsl:call-template name="make.roff.metadata.author">
@@ -183,30 +294,30 @@ db:manvolnum
       </xsl:with-param>
     </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;&#x2593;" Generator: DocBook </xsl:text>
+    <xsl:text>.\" Generator: DocBook </xsl:text>
     <xsl:value-of select="$DistroTitle"/>
     <xsl:text> v</xsl:text>
     <xsl:call-template name="replace.dots.and.dashes">
       <xsl:with-param name="content" select="$VERSION"/>
     </xsl:call-template>
-    <xsl:text> &lt;http://docbook&#x2302;sf&#x2302;net/></xsl:text>
+    <xsl:text> &lt;http://docbook.sf.net/></xsl:text>
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;&#x2593;"      Date: </xsl:text>
+    <xsl:text>.\"      Date: </xsl:text>
     <xsl:call-template name="replace.dots.and.dashes">
       <xsl:with-param name="content" select="$date"/>
     </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;&#x2593;"    Manual: </xsl:text>
+    <xsl:text>.\"    Manual: </xsl:text>
     <xsl:call-template name="replace.dots.and.dashes">
       <xsl:with-param name="content" select="$manual"/>
     </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;&#x2593;"    Source: </xsl:text>
+    <xsl:text>.\"    Source: </xsl:text>
     <xsl:call-template name="replace.dots.and.dashes">
       <xsl:with-param name="content" select="$source"/>
     </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;&#x2593;"</xsl:text>
+    <xsl:text>.\"</xsl:text>
     <xsl:text>&#10;</xsl:text>
   </xsl:template>
 
@@ -255,7 +366,7 @@ db:manvolnum
     <!-- * is", unchanged from the DocBook source; and DTD-based -->
     <!-- * validation does not provide a way to constrain them to be -->
     <!-- * "space free" -->
-    <xsl:text>&#x2302;TH "</xsl:text>
+    <xsl:text>.TH "</xsl:text>
     <xsl:call-template name="string.upper">
       <xsl:with-param name="string">
         <xsl:choose>
@@ -317,32 +428,32 @@ db:manvolnum
     <!-- * If the value of man.hypenate is zero (the default), then -->
     <!-- * disable hyphenation (".nh" = "no hyphenation") -->
     <xsl:if test="$man.hyphenate = 0">
-      <xsl:text>&#x2302;&#x2593;" disable hyphenation&#10;</xsl:text>
-      <xsl:text>&#x2302;nh&#10;</xsl:text>
+      <xsl:text>.\" disable hyphenation&#10;</xsl:text>
+      <xsl:text>.nh&#10;</xsl:text>
     </xsl:if>
     <!-- * If the value of man.justify is zero (the default), then -->
     <!-- * disable justification (".ad l" means "adjust to left only") -->
     <xsl:if test="$man.justify = 0">
-      <xsl:text>&#x2302;&#x2593;" disable justification</xsl:text>
+      <xsl:text>.\" disable justification</xsl:text>
       <xsl:text> (adjust text to left margin only)&#10;</xsl:text>
-      <xsl:text>&#x2302;ad l&#10;</xsl:text>
+      <xsl:text>.ad l&#10;</xsl:text>
     </xsl:if>
     <xsl:if test="not($man.indent.refsect = 0)">
-      <xsl:text>&#x2302;&#x2593;" store initial "default indentation value"&#10;</xsl:text>
-      <xsl:text>&#x2302;nr zq &#x2593;n(IN&#10;</xsl:text>
-      <xsl:text>&#x2302;&#x2593;" adjust default indentation&#10;</xsl:text>
-      <xsl:text>&#x2302;nr IN </xsl:text>
+      <xsl:text>.\" store initial "default indentation value"&#10;</xsl:text>
+      <xsl:text>.nr zq \n(IN&#10;</xsl:text>
+      <xsl:text>.\" adjust default indentation&#10;</xsl:text>
+      <xsl:text>.nr IN </xsl:text>
       <xsl:value-of select="$man.indent.width"/>
       <xsl:text>&#10;</xsl:text>
-      <xsl:text>&#x2302;&#x2593;" adjust indentation of SS headings&#10;</xsl:text>
-      <xsl:text>&#x2302;nr SN &#x2593;n(IN&#10;</xsl:text>
+      <xsl:text>.\" adjust indentation of SS headings&#10;</xsl:text>
+      <xsl:text>.nr SN \n(IN&#10;</xsl:text>
     </xsl:if>
     <!-- * Unless the value of man.break.after.slash is zero (the -->
     <!-- * default), tell groff that it is OK to break a line -->
     <!-- * after a slash when needed. -->
     <xsl:if test="$man.break.after.slash != 0">
-      <xsl:text>&#x2302;&#x2593;" enable line breaks after slashes&#10;</xsl:text>
-      <xsl:text>&#x2302;cflags 4 /&#10;</xsl:text>
+      <xsl:text>.\" enable line breaks after slashes&#10;</xsl:text>
+      <xsl:text>.cflags 4 /&#10;</xsl:text>
     </xsl:if>
   </xsl:template>
 
index b5463684dc997ed79c71f31074f506e447c4ca1b..3634e79a5b2f3ccc6ac3b3a87f3720b8b2ff99b8 100644 (file)
       <xsl:when test="preceding-sibling::refnamediv">
         <!-- * No title on secondary refnamedivs! -->
         <!-- * Just put a single line break instead -->
-        <xsl:text>&#x2302;br&#10;</xsl:text>
+        <xsl:text>.br&#10;</xsl:text>
       </xsl:when>
       <xsl:otherwise>
         <xsl:call-template name="mark.subheading"/>
-        <xsl:text>&#x2302;SH "</xsl:text>
+        <xsl:text>.SH "</xsl:text>
         <xsl:apply-templates select="." mode="title.markup"/>
         <xsl:text>"</xsl:text>
         <xsl:text>&#10;</xsl:text>
@@ -65,7 +65,7 @@
 
   <xsl:template match="refsynopsisdiv">
     <xsl:call-template name="mark.subheading"/>
-    <xsl:text>&#x2302;SH "</xsl:text>
+    <xsl:text>.SH "</xsl:text>
     <xsl:apply-templates select="." mode="title.markup"/>
     <xsl:text>"&#10;</xsl:text>
     <xsl:call-template name="mark.subheading"/>
@@ -77,7 +77,7 @@
       <xsl:apply-templates select="." mode="title.markup"/>
     </xsl:variable>
     <xsl:call-template name="mark.subheading"/>
-    <xsl:text>&#x2302;SH "</xsl:text>
+    <xsl:text>.SH "</xsl:text>
     <xsl:value-of select="normalize-space($title)"/>
     <xsl:text>"&#10;</xsl:text>
     <xsl:call-template name="mark.subheading"/>
@@ -94,7 +94,7 @@
                   |title)[1]/node()"/>
       
     </xsl:variable>
-    <xsl:text>&#x2302;SS "</xsl:text>
+    <xsl:text>.SS "</xsl:text>
     <xsl:value-of select="normalize-space($title)"/>
     <xsl:text>"&#10;</xsl:text>
     <xsl:call-template name="mark.subheading"/>
       <!-- * If default-indentation adjustment is on, then indent the -->
       <!-- * child content of this Refsect2 -->
       <xsl:when test="not($man.indent.refsect = 0)">
-        <xsl:text>&#x2302;RS&#10;</xsl:text>
+        <xsl:text>.RS&#10;</xsl:text>
         <xsl:apply-templates/>
-        <xsl:text>&#x2302;RE&#10;</xsl:text>
+        <xsl:text>.RE&#10;</xsl:text>
       </xsl:when>
       <xsl:otherwise>
         <!-- * If default-indentation adjustment is on, then do not -->
       <!-- * child content of this Refsect3 or Refsection. -->
       <xsl:when test="not($man.indent.refsect != 0)">
         <xsl:call-template name="nested-section-title"/>
-        <xsl:text>&#x2302;RS&#10;</xsl:text>
+        <xsl:text>.RS&#10;</xsl:text>
         <xsl:apply-templates/>
-        <xsl:text>&#x2302;RE&#10;</xsl:text>
+        <xsl:text>.RE&#10;</xsl:text>
       </xsl:when>
       <xsl:otherwise>
         <!-- * If default-indentation adjustment is on, then do not -->
         <!-- * actually means the title is indented by the value of -->
         <!-- * the SN register, which appears by default to be -->
         <!-- * about half of the default indentation value -->
-        <xsl:text>&#x2302;ti (&#x2593;n(SNu * 5u / 3u)&#10;</xsl:text>
+        <xsl:text>.ti (\n(SNu * 5u / 3u)&#10;</xsl:text>
         <xsl:call-template name="nested-section-title"/>
         <xsl:apply-templates/>
       </xsl:otherwise>
       <xsl:if test="not($man.indent.refsect = 0)">
         <!-- * If default-indentation adjustment is on, then indent the -->
         <!-- * child content of this Refsect3 or Refsection. -->
-        <xsl:text>(&#x2593;n(SNu)&#10;</xsl:text>
+        <xsl:text>(\n(SNu)&#10;</xsl:text>
       </xsl:if>
     </xsl:variable>
     <xsl:call-template name="nested-section-title"/>
-    <xsl:text>&#x2302;RS (&#x2593;n(SNu)&#10;</xsl:text>
+    <xsl:text>.RS (\n(SNu)&#10;</xsl:text>
     <xsl:apply-templates/>
-    <xsl:text>&#x2302;RE&#10;</xsl:text>
+    <xsl:text>.RE&#10;</xsl:text>
   </xsl:template>
 
   <!-- ==================================================================== -->
index 2c69f370d7e209190aaa87087cdf30b8a8acb6f7..07678fc5ab9c4f9cc707c7891f5e1fef3368463f 100644 (file)
@@ -50,9 +50,9 @@
   <!-- * up one line vertically to negate the line of vertical space -->
   <!-- * that's added by the .HP macro -->
   <xsl:if test="preceding-sibling::*[1][self::synopfragment]">
-    <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
+    <xsl:text>.sp -1n&#10;</xsl:text>
   </xsl:if>
-  <xsl:text>&#x2302;HP </xsl:text>
+  <xsl:text>.HP </xsl:text>
   <!-- * For each Synopfragment, make a hanging paragraph, with the -->
   <!-- * indent calculated from the length of the generated number -->
   <!-- * used as a reference + pluse 3 characters (for the open and -->
 
 <xsl:template match="sbr">
   <xsl:text>&#x2592;</xsl:text>
-  <xsl:text>&#x2302;br&#x2592;</xsl:text>
+  <xsl:text>.br&#x2592;</xsl:text>
 </xsl:template>
 
 <xsl:template match="cmdsynopsis">
   <!-- * if justification is enabled by default, turn it off temporarily -->
   <xsl:if test="$man.justify != 0">
-    <xsl:text>&#x2302;ad l&#10;</xsl:text>
+    <xsl:text>.ad l&#10;</xsl:text>
   </xsl:if>
   <!-- * if hyphenation is enabled by default, turn it off temporarily -->
   <xsl:if test="$man.hyphenate != 0">
-    <xsl:text>&#x2302;hy 0&#10;</xsl:text>
+    <xsl:text>.hy 0&#10;</xsl:text>
   </xsl:if>
-  <xsl:text>&#x2302;HP </xsl:text>
+  <xsl:text>.HP </xsl:text>
   <xsl:value-of select="string-length (normalize-space (command)) + 1"/>
   <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates/>
   <xsl:text>&#10;</xsl:text>
   <!-- * if justification is enabled by default, turn it back on -->
   <xsl:if test="$man.justify != 0">
-    <xsl:text>&#x2302;ad&#10;</xsl:text>
+    <xsl:text>.ad&#10;</xsl:text>
   </xsl:if>
   <!-- * if hyphenation is enabled by default, turn it back on -->
   <xsl:if test="$man.hyphenate != 0">
-    <xsl:text>&#x2302;hy&#10;</xsl:text>
+    <xsl:text>.hy&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
 <xsl:template match="funcsynopsis">
   <!-- * if justification is enabled by default, turn it off temporarily -->
   <xsl:if test="$man.justify != 0">
-    <xsl:text>&#x2302;ad l&#10;</xsl:text>
+    <xsl:text>.ad l&#10;</xsl:text>
   </xsl:if>
   <!-- * if hyphenation is enabled by default, turn it off temporarily -->
   <xsl:if test="$man.hyphenate != 0">
-    <xsl:text>&#x2302;hy 0&#10;</xsl:text>
+    <xsl:text>.hy 0&#10;</xsl:text>
   </xsl:if>
   <xsl:apply-templates/>
   <!-- * if justification is enabled by default, turn it back on -->
   <xsl:if test="$man.justify != 0">
-    <xsl:text>&#x2302;ad&#10;</xsl:text>
+    <xsl:text>.ad&#10;</xsl:text>
   </xsl:if>
   <!-- * if hyphenation is enabled by default, turn it back on -->
   <xsl:if test="$man.hyphenate != 0">
-    <xsl:text>&#x2302;hy&#10;</xsl:text>
+    <xsl:text>.hy&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
   <xsl:variable name="funcprototype">
     <xsl:apply-templates select="funcdef"/>
   </xsl:variable>
-  <xsl:text>&#x2302;HP </xsl:text>
+  <xsl:text>.HP </xsl:text>
   <!-- * Hang Paragraph by length of string value of <funcdef> + 1 -->
   <!-- * (because funcdef is always followed by one open paren char) -->
   <xsl:value-of select="string-length (normalize-space ($funcprototype.string.value)) + 1"/>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>&#x2302;</xsl:text>
+  <xsl:text>.</xsl:text>
   <xsl:value-of select="$man.font.funcprototype"/>
   <xsl:text> </xsl:text>
   <!-- * The following quotation mark (and the one further below) are -->
 </xsl:template>
 
 <xsl:template match="paramdef/parameter">
-  <!-- * x2008 is a "punctuation space"; we use it here because if we -->
+  <!-- * We use U+2591 here in place of a normal space, because if we -->
   <!-- * were to just use a normal space, it would get replaced with a -->
   <!-- * non-breaking space when we run the whole Paramdef through the -->
   <!-- * prevent.line.breaking template. And as far as why we're -->
-  <!-- * inserting the space an quotation marks around each Parameter to -->
-  <!-- * begin with, the reason is that we need to because we are -->
+  <!-- * inserting the space and quotation marks around each Parameter -->
+  <!-- * to begin with, the reason is that we need to because we are -->
   <!-- * outputting Funcsynopsis in either the "BI" or "RI" font, and -->
   <!-- * the space and quotation marks delimit the text as the -->
   <!-- * "alternate" or "I" text that needs to be rendered in italic. -->
-  <xsl:text>"&#x2008;"</xsl:text>
+  <xsl:text>"&#x2591;"</xsl:text>
   <xsl:apply-templates/>
-  <xsl:text>"&#x2008;"</xsl:text>
+  <xsl:text>"&#x2591;"</xsl:text>
 </xsl:template>
 
 <xsl:template match="funcparams">
index 921f1487239e99d27913654c96650727055ba155..ea15126e5d7bc9ad5888e92000d52726fca1aea0 100644 (file)
       <!-- *   Output table title                                           -->
       <!-- * ============================================================== -->
       <xsl:if test="$title != '' or parent::td">
-        <xsl:text>&#x2302;PP&#10;</xsl:text>
+        <xsl:text>.PP&#10;</xsl:text>
         <xsl:text>.</xsl:text>
         <xsl:value-of select="$tbl.font.title"/>
         <xsl:text> </xsl:text>
         </xsl:if>
         <xsl:value-of select="normalize-space($title)"/>
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
+        <xsl:text>.sp -1n&#10;</xsl:text>
       </xsl:if>
       
       <!-- * mark the start of the table -->
       <!-- * "TS" = "table start" -->
-      <xsl:text>&#x2302;TS</xsl:text>
+      <xsl:text>.TS</xsl:text>
       <xsl:if test="thead and $tbl.running.header.from.thead">
         <!-- * H = "has header" -->
         <xsl:text> H</xsl:text>
         <xsl:choose>
           <xsl:when test="$tbl.running.header.from.thead">
             <!-- * "TH" = "table header end" -->
-            <xsl:text>&#x2302;TH&#10;</xsl:text>
+            <xsl:text>.TH&#10;</xsl:text>
           </xsl:when>
           <xsl:otherwise>
             <!-- * "T&" = "table continuation" and is meant just as a kind -->
             <!-- * rows. It's necessary to output it here because the "TH" -->
             <!-- * macro is not being output, so there's otherwise no way -->
             <!-- * for tbl(1) to know we have the table "sectioned". -->
-            <xsl:text>&#x2302;T&amp;&#10;</xsl:text>
+            <xsl:text>.T&amp;&#10;</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:if>
       <!-- * mark the end of the table -->
       <xsl:text>&#10;</xsl:text>
       <!-- * .TE = "Table End" -->
-      <xsl:text>&#x2302;TE&#10;</xsl:text>
+      <xsl:text>.TE&#10;</xsl:text>
       <!-- * put a blank line of space below the table -->
-      <xsl:text>&#x2302;sp&#10;</xsl:text>
+      <xsl:text>.sp&#10;</xsl:text>
     </xsl:for-each>
   </xsl:template>
 
               >tbl convert : Extracted a nested table</xsl:text>
             </xsl:with-param>
           </xsl:call-template>
-          <xsl:text>[&#x2593;fInested&#x2580;table&#x2593;fR]*&#10;</xsl:text>
+          <xsl:text>[\fInested&#x2580;table\fR]*&#10;</xsl:text>
         </xsl:when>
         <xsl:otherwise>
           <!-- * Apply templates to the child contents of this cell, to -->
       <xsl:when test="$rowspan > 1">
         <!-- * Tail recurse until we have no more rowspans, creating -->
         <!-- * an empty dummy cell each time. The type value, '^' -->
-        <!-- * is the marker that tbl(1) uses for indicates a -->
+        <!-- * is the marker that tbl(1) uses to indicate a -->
         <!-- * "vertically spanned heading". -->
         <cell row="{$row}" slot="{$slot}" type="^" colspan="{@colspan}"/>
         <xsl:call-template name="create.dummy.cells">
     <xsl:param name="cells"/>
     <xsl:apply-templates mode="table.format" select="$cells"/>
     <!-- * last line of table format section must end with a dot -->
-    <!-- * we use U+2302 internally to mark dots, and replace them -->
-    <!-- * with real dots before serializing to output -->
-    <xsl:text>&#x2302;</xsl:text>
+    <xsl:text>.</xsl:text>
   </xsl:template>
 
   <xsl:template match="cell" mode="table.format">
                   select=".//tgroup//footnote"/>
     <xsl:value-of select="$man.table.footnotes.divider"/>
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;br&#10;</xsl:text>
+    <xsl:text>.br&#10;</xsl:text>
     <xsl:apply-templates select="*[1]" mode="footnote.body.number"/>
     <xsl:apply-templates select="*[position() &gt; 1]"/>
   </xsl:template>
index beaaceba5455bcfdc192cb4f3ccba8c627a16156..1ae62af6369b740be8b2f676363ae3f6f661759c 100644 (file)
 
   <xsl:template mode="bold" match="*">
     <xsl:for-each select="node()">
-      <xsl:text>&#x2593;fB</xsl:text>
+      <xsl:text>\fB</xsl:text>
       <xsl:apply-templates select="."/>
-      <xsl:text>&#x2593;fR</xsl:text>
+      <xsl:text>\fR</xsl:text>
     </xsl:for-each>
   </xsl:template>
 
   <xsl:template mode="italic" match="*">
     <xsl:for-each select="node()">
-      <xsl:text>&#x2593;fI</xsl:text>
+      <xsl:text>\fI</xsl:text>
       <xsl:apply-templates select="."/>
-      <xsl:text>&#x2593;fR</xsl:text>
+      <xsl:text>\fR</xsl:text>
     </xsl:for-each>
   </xsl:template>
 
@@ -95,7 +95,7 @@
     <xsl:if test="$man.hyphenate != 0 and
                   not(ancestor::cmdsynopsis) and
                   not(ancestor::funcsynopsis)">
-      <xsl:text>&#x2593;%</xsl:text>
+      <xsl:text>\%</xsl:text>
     </xsl:if>
   </xsl:template>
 
     <xsl:variable name="dot-content">
       <xsl:call-template name="string.subst">
         <xsl:with-param name="string" select="$content"/>
-        <xsl:with-param name="target" select="'.'"/>
-        <xsl:with-param name="replacement" select="'&#x2302;'"/>
+        <xsl:with-param name="target" select="'\.'"/>
+        <xsl:with-param name="replacement" select="'.'"/>
       </xsl:call-template>
     </xsl:variable>
     <xsl:call-template name="string.subst">
       <xsl:with-param name="string" select="$dot-content"/>
-      <xsl:with-param name="target" select="'-'"/>
-      <xsl:with-param name="replacement" select="'&#x2591;'"/>
+      <xsl:with-param name="target" select="'\-'"/>
+      <xsl:with-param name="replacement" select="'-'"/>
     </xsl:call-template>
   </xsl:template>
 
   <xsl:template name="nested-section-title">
     <!-- * The next few lines are some arcane roff code to control line -->
     <!-- * spacing after headings. -->
-    <xsl:text>&#x2302;sp&#10;</xsl:text>
-    <xsl:text>&#x2302;it 1 an&#x2591;trap&#10;</xsl:text>
-    <xsl:text>&#x2302;nr an&#x2591;no&#x2591;space&#x2591;flag 1&#10;</xsl:text>
-    <xsl:text>&#x2302;nr an&#x2591;break&#x2591;flag 1&#10;</xsl:text>
-    <xsl:text>&#x2302;br&#10;</xsl:text>
+    <xsl:text>.sp&#10;</xsl:text>
+    <xsl:text>.it 1 an-trap&#10;</xsl:text>
+    <xsl:text>.nr an-no-space-flag 1&#10;</xsl:text>
+    <xsl:text>.nr an-break-flag 1&#10;</xsl:text>
+    <xsl:text>.br&#10;</xsl:text>
     <!-- * make title wrapper so that we can use mode="bold" template to -->
     <!-- * apply character formatting to it -->
     <xsl:variable name="title.wrapper">
         <xsl:when test="self::address|self::literallayout|self::programlisting|
                         self::screen|self::synopsis">
           <xsl:text>&#10;</xsl:text>
-          <xsl:text>&#x2302;sp&#10;</xsl:text>
+          <xsl:text>.sp&#10;</xsl:text>
           <xsl:call-template name="mark.up.block.start"/>
           <xsl:apply-templates select="."/>
         </xsl:when>
                       preceding-sibling::note|
                       preceding-sibling::tip|
                       preceding-sibling::warning)">
-          <xsl:text>&#x2302;RS</xsl:text>
+          <xsl:text>.RS</xsl:text>
           <xsl:if test="not($list-indent = '')">
             <xsl:text> </xsl:text>
             <xsl:value-of select="$list-indent"/>
                     tip|
                     warning">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;RE</xsl:text>
+        <xsl:text>.RE</xsl:text>
       <xsl:text>&#10;</xsl:text>
       </xsl:if>
     </xsl:if>
   <!-- * in roff source (just to make things easier to read). -->
   <xsl:template name="mark.subheading">
     <xsl:if test="$man.subheading.divider.enabled != 0">
-      <xsl:text>&#x2302;&#x2593;" </xsl:text>
+      <xsl:text>.\" </xsl:text>
       <xsl:value-of select="$man.subheading.divider"/>
       <xsl:text>&#10;</xsl:text>
     </xsl:if>
index 4a135485b5996d4010a1c5f03b97be1db996c835..8c4cf7df7dc0f10fc2c029d3a88222ccb95ac9b1 100644 (file)
 <src:fragment xml:id="man.string.subst.map.frag">
 <xsl:param name="man.string.subst.map">
 
-  <!-- ******************************************************************** -->
-  <!-- *  -->
-  <!-- * The backslash and dot (\, .) characters have special meaning -->
-  <!-- * for roff, so we escape those characters when they appear in -->
-  <!-- * the source content, and we use certain (arbitrarily -->
-  <!-- * selected) Unicode characters as the internal representations -->
-  <!-- * for those characters, then replace them with real -->
-  <!-- * backslashes and dots in output. In addition, for certain -->
-  <!-- * reasons, we do the same thing for dashes. The mappings of -->
-  <!-- * those characters to the Unicode characters we use to -->
-  <!-- * represent them is hard-coded: -->
-  <!-- *  -->
-  <!-- *   - U+2591 = dash -->
-  <!-- *   - U+2593 = backslash -->
-  <!-- *   - U+2302 = dot -->
-  <!-- *  -->
-  <!-- ******************************************************************** -->
-
-  <!-- * escape backslashes in content; we use "\e" instead of "\\" -->
-  <!-- * because the groff docs say that's the correct thing to do; also -->
-  <!-- * because testing shows that "\\" doesn't always work as expected; -->
-  <!-- * for example, "\\" within a table seems to mess things up -->
-  <ss:substitution oldstring="\" newstring="\e"/>
   <!-- * fix bad font-request capitalization in .SH (stylesheet artifact) -->
   <ss:substitution oldstring="&#x2593;FB" newstring="\fB"/>
   <ss:substitution oldstring="&#x2593;FI" newstring="\fI"/>
   <ss:substitution oldstring="&#x2592;&#x2580;" newstring="&#x2592;"/>
   <!-- * replace U+2580 no-break marker (stylesheet-added) w/ no-break space -->
   <ss:substitution oldstring="&#x2580;" newstring="\ "/>
-  <!-- * replace U+2593 marker with backslash --> 
-  <ss:substitution oldstring="&#x2593;" newstring="\"/>
-  <!-- * escape dots in content (only at line beginnings) -->
-  <ss:substitution oldstring="&#10;." newstring="&#10;\&amp;."/>
-  <!-- * replace U+2302 marker with dot -->
-  <ss:substitution oldstring="&#x2302;" newstring="."/>
-  <!-- * escape dashes in content -->
-  <ss:substitution oldstring="-" newstring="\-"/>
-  <!-- * replace U+2591 marker with dash -->
-  <ss:substitution oldstring="&#x2591;" newstring="-"/>
 
   <!-- ==================================================================== -->
 
   <ss:substitution oldstring=".nf&#10;&#10;" newstring=".nf&#10;"/>
   <!-- * squeeze multiple newlines after REstoring margin -->
   <ss:substitution oldstring=".RE&#10;&#10;" newstring=".RE&#10;"/>
-  <!-- * an apostrophe at the beginning of a line gets interpreted as a -->
-  <!-- * roff request (groff(7) says it is "the non-breaking control -->
-  <!-- * character"); so we must add backslash before any apostrophe -->
-  <!-- * found at the start of a line -->
-  <ss:substitution oldstring="&#10;'" newstring="&#10;\'"/>
-  <!-- * -->
-  <!-- * non-breaking space -->
-  <!-- * -->
-  <!-- * A no-break space can be written two ways in roff; the difference, -->
-  <!-- * according to the "Page Motions" node in the groff info page, ixsl: -->
-  <!-- * -->
-  <!-- *   "\ " = -->
-  <!-- *   An unbreakable and unpaddable (i.e. not expanded during filling) -->
-  <!-- *   space. -->
-  <!-- * -->
-  <!-- *   "\~" = -->
-  <!-- *   An unbreakable space that stretches like a normal -->
-  <!-- *   inter-word space when a line is adjusted."  -->
-  <!-- * -->
-  <!-- * Unfortunately, roff seems to do some weird things with long -->
-  <!-- * lines that only have words separated by "\~" spaces, so it's -->
-  <!-- * safer just to stick with the "\ " space -->
-  <ss:substitution oldstring="&#x00a0;" newstring="\ "/>
-  <!-- * x2008 is a "punctuation space"; we must replace it here because, -->
-  <!-- * for certain reasons, the stylesheets add it before and after -->
-  <!-- * every Parameter in Funcprototype output -->
-  <ss:substitution oldstring="&#x2008;" newstring=" "/>
+  <!-- * U+2591 is a marker we add before and after every Parameter in -->
+  <!-- * Funcprototype output -->
+  <ss:substitution oldstring="&#x2591;" newstring=" "/>
+  <!-- * U+2592 is a marker we add for the newline before output of <sbr>; -->
+  <ss:substitution oldstring="&#x2592;" newstring="&#10;"/>
   <!-- * -->
   <!-- * Now deal with some other characters that are added by the -->
   <!-- * stylesheets during processing. -->
   <ss:substitution oldstring="©" newstring="\(co"/>
   <!-- * registered sign -->
   <ss:substitution oldstring="®" newstring="\(rg"/>
-  <!-- * servicemark... -->
+  <!-- * ...servicemark... -->
   <!-- * There is no groff equivalent for it. -->
   <ss:substitution oldstring="&#x2120;" newstring="(SM)"/>
-  <!-- * trademark... -->
+  <!-- * ...trademark... -->
   <!-- * We don't do "\(tm" because for console output, -->
   <!-- * groff just renders that as "tm"; that is: -->
   <!-- * -->
   <!-- *   Product&#x2122; -> Product(TM) -->
   <ss:substitution oldstring="™" newstring="(TM)"/>
 
-  <!-- ==================================================================== -->
-
-  <!-- * we use U+2592 as a marker for the newline before output of <sbr>; -->
-  <!-- * so we now need to replace U+2592 marker with a real newline -->
-  <ss:substitution oldstring="&#x2592;" newstring="&#10;"/>
-
 </xsl:param>
 </src:fragment>
 </refsynopsisdiv>