- Timestamp:
- Mar 28, 2023 1:51:21 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/docbook-refentry-to-manual-dita.xsl
r99191 r99198 38 38 <xsl:preserve-space elements="*"/> 39 39 <!-- xsl:strip-space elements="*"/ - never --> 40 41 42 <!-- - - - - - - - - - - - - - - - - - - - - - - 43 parameters 44 - - - - - - - - - - - - - - - - - - - - - - --> 45 <!-- Replace dashes with non-breaking dashes. 46 Note! If the monospace font used in the PDF doesn't support it, 47 then '#' shows up instead for instance. This is currently 48 the case, so it's disabled by default. --> 49 <xsl:param name="g_fReplaceHypens">false</xsl:param> 40 50 41 51 … … 325 335 <xsl:element name="kwd"> 326 336 <xsl:attribute name="rev">command/text</xsl:attribute> 327 <xsl: value-of select="."/>337 <xsl:call-template name="emit-text-with-replacements"/> 328 338 </xsl:element> 329 339 </xsl:template> … … 385 395 <xsl:element name="kwd"> 386 396 <xsl:attribute name="rev">arg=</xsl:attribute> 387 <xsl:value-of select="substring(., 1, string-length(.) - 1)"/> 397 <xsl:call-template name="emit-text-with-replacements"> 398 <xsl:with-param name="a_sText" select="substring(., 1, string-length(.) - 1)"/> 399 </xsl:call-template> 388 400 </xsl:element> 389 401 <xsl:element name="delim"> … … 397 409 <xsl:element name="sep"> 398 410 <xsl:attribute name="rev">arg-space</xsl:attribute> 399 <xsl: value-of select="."/>411 <xsl:text> </xsl:text> 400 412 </xsl:element> 401 413 </xsl:when> … … 421 433 <xsl:element name="kwd"> 422 434 <xsl:attribute name="rev">arg</xsl:attribute> 423 <xsl:value-of select="normalize-space(.)"/> 435 <xsl:call-template name="emit-text-with-replacements"> 436 <xsl:with-param name="a_sText" select="normalize-space(.)"/> 437 </xsl:call-template> 424 438 </xsl:element> 425 439 <xsl:if test="normalize-space(substring(., string-length(.), 1)) = '' … … 745 759 <xsl:value-of select="substring($text,2)"/> 746 760 </xsl:template> 761 762 763 <!-- 764 Maybe replace hypens (dashes) with non-breaking ones. 765 --> 766 <xsl:template name="emit-text-with-replacements"> 767 <xsl:param name="a_sText" select="."/> 768 <xsl:choose> 769 <xsl:when test="$g_fReplaceHypens = 'true' or $g_fReplaceHypens = 'yes'"> 770 <xsl:message terminate="yes">wtf?</xsl:message> 771 <xsl:call-template name="str:subst"> 772 <xsl:with-param name="text" select="$a_sText"/> 773 <xsl:with-param name="replace">-</xsl:with-param> 774 <xsl:with-param name="with">‑</xsl:with-param> <!-- U+2011 / ‑ --> 775 </xsl:call-template> 776 </xsl:when> 777 <xsl:otherwise> 778 <xsl:value-of select="$a_sText"/> 779 </xsl:otherwise> 780 </xsl:choose> 781 </xsl:template> 782 747 783 748 784 <!--
Note:
See TracChangeset
for help on using the changeset viewer.