mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 02:35:20 +00:00
Fix bug #10705
Seemingly, std::regex does not account for newlines in the string.
This commit is contained in:
parent
4499680bd9
commit
68bc505029
@ -420,7 +420,11 @@ docstring InsetListings::getCaption(OutputParams const & runparams) const
|
|||||||
// NOTE that } is not allowed in blah2.
|
// NOTE that } is not allowed in blah2.
|
||||||
regex const reg("(.*)\\\\label\\{(.*?)\\}(.*)");
|
regex const reg("(.*)\\\\label\\{(.*?)\\}(.*)");
|
||||||
string const new_cap("$1$3},label={$2");
|
string const new_cap("$1$3},label={$2");
|
||||||
return from_utf8(regex_replace(to_utf8(cap), reg, new_cap));
|
// Replace '\n' with an improbable character from Private Use Area-A
|
||||||
|
// and then return to '\n' after the regex replacement.
|
||||||
|
string const capstr = to_utf8(subst(cap, char_type('\n'), 0xffffd));
|
||||||
|
return subst(from_utf8(regex_replace(capstr, reg, new_cap)),
|
||||||
|
0xffffd, char_type('\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +49,9 @@ What's new
|
|||||||
|
|
||||||
- Catch "! Incomplete \if[x]" LaTeX error (bug 10666).
|
- Catch "! Incomplete \if[x]" LaTeX error (bug 10666).
|
||||||
|
|
||||||
|
- Fix caption handling in listings insets when it is split into multiple
|
||||||
|
lines in the LaTeX output (bug 10705).
|
||||||
|
|
||||||
|
|
||||||
* LYX2LYX
|
* LYX2LYX
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user