Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64980 - in branches/release/tools/boostbook: . test/more test/more/tests test/more/tests/libs test/more/tests/syntax-highlight xsl
From: dnljms_at_[hidden]
Date: 2010-08-24 03:54:06


Author: danieljames
Date: 2010-08-24 03:54:04 EDT (Tue, 24 Aug 2010)
New Revision: 64980
URL: http://svn.boost.org/trac/boost/changeset/64980

Log:
Fix boostbook comments at the end of code blocks.
Added:
   branches/release/tools/boostbook/test/more/
      - copied from r64977, /trunk/tools/boostbook/test/more/
   branches/release/tools/boostbook/test/more/run-tests.py
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/run-tests.py
   branches/release/tools/boostbook/test/more/tests/
      - copied from r64977, /trunk/tools/boostbook/test/more/tests/
   branches/release/tools/boostbook/test/more/tests/libs/
      - copied from r64977, /trunk/tools/boostbook/test/more/tests/libs/
   branches/release/tools/boostbook/test/more/tests/libs/array.gold
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/libs/array.gold
   branches/release/tools/boostbook/test/more/tests/libs/array.xml
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/libs/array.xml
   branches/release/tools/boostbook/test/more/tests/libs/hash-ref.gold
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/libs/hash-ref.gold
   branches/release/tools/boostbook/test/more/tests/libs/hash-ref.xml
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/libs/hash-ref.xml
   branches/release/tools/boostbook/test/more/tests/libs/unordered-ref.gold
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/libs/unordered-ref.gold
   branches/release/tools/boostbook/test/more/tests/libs/unordered-ref.xml
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/libs/unordered-ref.xml
   branches/release/tools/boostbook/test/more/tests/syntax-highlight/
      - copied from r64977, /trunk/tools/boostbook/test/more/tests/syntax-highlight/
   branches/release/tools/boostbook/test/more/tests/syntax-highlight/comments.gold
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/syntax-highlight/comments.gold
   branches/release/tools/boostbook/test/more/tests/syntax-highlight/comments.xml
      - copied unchanged from r64977, /trunk/tools/boostbook/test/more/tests/syntax-highlight/comments.xml
Properties modified:
   branches/release/tools/boostbook/ (props changed)
Text files modified:
   branches/release/tools/boostbook/xsl/source-highlight.xsl | 43 ++++++++++++++++++++++++++++-----------
   1 files changed, 31 insertions(+), 12 deletions(-)

Modified: branches/release/tools/boostbook/xsl/source-highlight.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/source-highlight.xsl (original)
+++ branches/release/tools/boostbook/xsl/source-highlight.xsl 2010-08-24 03:54:04 EDT (Tue, 24 Aug 2010)
@@ -363,20 +363,39 @@
         </xsl:call-template>
       </xsl:when>
       <xsl:when test="substring($text, 1, 2) = '//'">
- <xsl:call-template name="highlight-comment">
- <xsl:with-param name="text" select="substring-before($text, '&#xA;')"/>
- </xsl:call-template>
- <xsl:call-template name="highlight-text-impl-root">
- <xsl:with-param name="text" select="concat('&#xA;', substring-after($text, '&#xA;'))"/>
- </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="contains($text, '&#xA;')">
+ <xsl:call-template name="highlight-comment">
+ <xsl:with-param name="text" select="substring-before($text, '&#xA;')"/>
+ </xsl:call-template>
+ <xsl:call-template name="highlight-text-impl-root">
+ <xsl:with-param name="text" select="concat('&#xA;', substring-after($text, '&#xA;'))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="highlight-comment">
+ <xsl:with-param name="text" select="$text"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
       </xsl:when>
       <xsl:when test="substring($text, 1, 2) = '/*'">
- <xsl:call-template name="highlight-comment">
- <xsl:with-param name="text" select="concat(substring-before($text, '*/'), '*/')"/>
- </xsl:call-template>
- <xsl:call-template name="highlight-text-impl-root">
- <xsl:with-param name="text" select="substring-after($text, '*/')"/>
- </xsl:call-template>
+ <xsl:variable name="after-start" select="substring($text, 3)" />
+ <xsl:choose>
+ <xsl:when test="contains($after-start, '*/')">
+ <xsl:call-template name="highlight-comment">
+ <xsl:with-param name="text" select="concat('/*', substring-before($after-start, '*/'), '*/')"/>
+ </xsl:call-template>
+ <xsl:call-template name="highlight-text-impl-root">
+ <xsl:with-param name="text" select="substring-after($after-start, '*/')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="highlight-comment">
+ <xsl:with-param name="text" select="$text"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
       </xsl:when>
       <xsl:when test="contains('&#xA;&#xD;', substring($text, 1, 1))">
         <xsl:value-of select="substring($text, 1, 1)"/>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk