Braces need to be escaped as well on LATEXIFY

part of #9563
This commit is contained in:
Juergen Spitzmueller 2018-03-06 18:17:01 +01:00
parent 7a22ce7c09
commit e43ba7cf46

View 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) {