Changeset 98098 in vbox
- Timestamp:
- Jan 17, 2023 12:53:30 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/docbook-refentry-to-C-help.xsl
r96407 r98098 48 48 <xsl:text>-------------------------------------------------------------------------------------------------------------------</xsl:text> 49 49 </xsl:variable> 50 <xsl:variable name="g_sNewLine"><xsl:value-of select="' '" /></xsl:variable> 50 51 51 52 <!-- Sub-command style command (true) or single command (false). --> … … 494 495 </xsl:template> 495 496 497 <!-- Normalizes the current text node taking tailing and leading spaces 498 into account (unlike normalize-space which strips them mercilessly). --> 499 <xsl:template name="my-normalize-space-current"> 500 <!-- <xsl:message>dbg0: position=<xsl:value-of select="position()"/> last=<xsl:value-of select="last()"/> .=|<xsl:value-of select="."/>|</xsl:message> --> 501 <xsl:if test="(starts-with(.,' ') or starts-with(., $g_sNewLine)) and position() != 1"> 502 <xsl:value-of select="' '"/> 503 </xsl:if> 504 <xsl:value-of select="normalize-space(.)"/> 505 <xsl:if test="((substring(.,string-length(.)) = ' ') or (substring(.,string-length(.)) = $g_sNewLine)) and position() != last()"> 506 <xsl:value-of select="' '"/> 507 </xsl:if> 508 </xsl:template> 496 509 497 510 <!-- … … 500 513 <xsl:template match="text()" name="escape_text"> 501 514 <!-- Leading whitespace hack! --> 502 <xsl:if test=" substring(.,1,1) = ' 'and position() != 1">515 <xsl:if test="(starts-with(.,' ') or starts-with(.,$g_sNewLine)) and position() != 1"> 503 516 <xsl:text> </xsl:text> 504 517 <xsl:if test="boolean($g_fDebugText)"> 505 <xsl:message>text: add space</xsl:message>518 <xsl:message>text: add lead space</xsl:message> 506 519 </xsl:if> 507 520 </xsl:if> … … 529 542 <xsl:value-of select="$sTmp2"/> 530 543 <xsl:if test="boolean($g_fDebugText)"> 531 <xsl:message>text: |<xsl:value-of select="$sTmp2"/>| </xsl:message>544 <xsl:message>text: |<xsl:value-of select="$sTmp2"/>|(1)</xsl:message> 532 545 </xsl:if> 533 546 </xsl:when> … … 536 549 <xsl:value-of select="normalize-space(.)"/> 537 550 <xsl:if test="boolean($g_fDebugText)"> 538 <xsl:message>text: |<xsl:value-of select="normalize-space(.)"/>| </xsl:message>551 <xsl:message>text: |<xsl:value-of select="normalize-space(.)"/>|(2)</xsl:message> 539 552 </xsl:if> 540 553 </xsl:otherwise> … … 542 555 543 556 <!-- Trailing whitespace hack! --> 544 <xsl:if test=" substring(.,string-length(.)) = ' 'and position() != last() and string-length(.) != 1">557 <xsl:if test="(substring(.,string-length(.)) = ' ' or substring(.,string-length(.)) = $g_sNewLine) and position() != last() and string-length(.) != 1"> 545 558 <xsl:text> </xsl:text> 546 559 <xsl:if test="boolean($g_fDebugText)"> 547 <xsl:message>text: add space</xsl:message>560 <xsl:message>text: add tail space</xsl:message> 548 561 </xsl:if> 549 562 </xsl:if> … … 553 566 <!-- Elements producing non-breaking strings (single line). --> 554 567 <xsl:template match="command/text()|option/text()|computeroutput/text()|arg/text()|filename/text()" name="escape_fixed_text"> 555 <xsl:param name="sText" select="normalize-space(.)"/>568 <xsl:param name="sText"><xsl:call-template name="my-normalize-space-current"/></xsl:param> 556 569 <xsl:choose> 557 570
Note:
See TracChangeset
for help on using the changeset viewer.