mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix bug #8116.
The string we parse as name may contain backslashes if \csname ... \endcsname is used. Therefore we have to output it using asInput() instead of cs().
This commit is contained in:
parent
bba0c9aa22
commit
72023030d9
@ -1269,8 +1269,12 @@ void Preamble::parse(Parser & p, string const & forceclass,
|
||||
|
||||
else if (t.cs() == "def") {
|
||||
string name = p.get_token().cs();
|
||||
// In fact, name may be more than the name:
|
||||
// In the test case of bug 8116
|
||||
// name == "csname SF@gobble@opt \endcsname".
|
||||
// Therefore, we need to use asInput() instead of cs().
|
||||
while (p.next_token().cat() != catBegin)
|
||||
name += p.get_token().cs();
|
||||
name += p.get_token().asInput();
|
||||
if (!in_lyx_preamble)
|
||||
h_preamble << "\\def\\" << name << '{'
|
||||
<< p.verbatim_item() << "}";
|
||||
|
Loading…
Reference in New Issue
Block a user