commit f457b11fa74d8ab209f73ce666fc891f06c6802d
Author: Richard Heck <[email protected]>
Date:   Sun Jul 31 00:15:48 2016 -0400

    Fix substitution for $$Contents.
    
    The second argument here is the length of the string to replace,
    not the position of the final character.
    
    (cherry picked from commit 6b97f2c0751ff79fc19ea0e11b4ef957fd71324c)
---
 src/insets/ExternalSupport.cpp |    2 +-
 status.22x                     |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp
index cbbb88b..0bf589a 100644
--- a/src/insets/ExternalSupport.cpp
+++ b/src/insets/ExternalSupport.cpp
@@ -199,7 +199,7 @@ string const doSubstitution(InsetExternalParams const & 
params,
 
                size_t const pos = result.find("$$Contents(\"");
                size_t const end = result.find("\")", pos);
-               result.replace(pos, end + 2, contents);
+               result.replace(pos, end + 2- pos, contents);
        }
 
        return result;
diff --git a/status.22x b/status.22x
index 35acf5e..a4a3072 100644
--- a/status.22x
+++ b/status.22x
@@ -45,6 +45,8 @@ What's new
 
 - Fixed preview of external material with plaintext and DocBook.
 
+- Fixed substitution for $$Contents in external templates.
+
 
 * LYX2LYX
 

Reply via email to