]> git.lyx.org Git - features.git/commitdiff
Braces need to be escaped as well on LATEXIFY
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 6 Mar 2018 17:17:01 +0000 (18:17 +0100)
committerRichard Heck <rgheck@lyx.org>
Sat, 17 Mar 2018 19:44:05 +0000 (15:44 -0400)
part of #9563

src/insets/InsetCommandParams.cpp
status.23x

index 39c7715dc5b1cda6f820dad32b54c24f1703da32..741f6aa9405c7708a2e990a7d240b240ac7f7da8 100644 (file)
@@ -464,14 +464,15 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams,
                }
                // Now escape special commands
                static docstring const backslash = from_ascii("\\");
-               static char_type const chars_escape[6] = {
-                       '&', '_', '$', '%', '#', '^'};
+               int const nchars_escape = 8;
+               static char_type const chars_escape[nchars_escape] = {
+                       '&', '_', '$', '%', '#', '^', '{', '}'};
 
                if (!result.empty()) {
                        int previous;
                        // The characters in chars_name[] need to be changed to a command when
                        // they are LaTeXified.
-                       for (int k = 0; k < 6; k++)
+                       for (int k = 0; k < nchars_escape; k++)
                                for (size_t i = 0, pos;
                                        (pos = result.find(chars_escape[k], i)) != string::npos;
                                        i = pos + 2) {
index 6c719629c788ee05d03fd70e511b0dba8e91ebba..c659e78e21866b33b25ae99c2a5e58fd9c96a9e2 100644 (file)
@@ -41,6 +41,8 @@ What's new
 
 - Fix the implementation of new libertine font package.
 
+- Properly escape braces in non-literate context in insets.
+
 
 * LYX2LYX