mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Beautify documents created by writer2latex (see bug #5187).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40235 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3f8a615477
commit
76e90badc0
@ -2079,8 +2079,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
os << t.cs();
|
os << t.cs();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cat() == catBegin &&
|
else if (t.cat() == catBegin) {
|
||||||
p.next_token().cat() == catEnd) {
|
Token const next = p.next_token();
|
||||||
|
Token const end = p.next_next_token();
|
||||||
|
if (next.cat() == catEnd) {
|
||||||
// {}
|
// {}
|
||||||
Token const prev = p.prev_token();
|
Token const prev = p.prev_token();
|
||||||
p.get_token();
|
p.get_token();
|
||||||
@ -2090,14 +2092,19 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
; // ignore it in {}`` or -{}-
|
; // ignore it in {}`` or -{}-
|
||||||
else
|
else
|
||||||
handle_ert(os, "{}", context);
|
handle_ert(os, "{}", context);
|
||||||
|
} else if (next.cat() == catEscape &&
|
||||||
}
|
is_known(next.cs(), known_quotes) &&
|
||||||
|
end.cat() == catEnd) {
|
||||||
else if (t.cat() == catBegin) {
|
// Something like {\textquoteright} (e.g.
|
||||||
|
// from writer2latex). LyX writes
|
||||||
|
// \textquoteright{}, so we may skip the
|
||||||
|
// braces here for better readability.
|
||||||
|
parse_text_snippet(p, os, FLAG_BRACE_LAST,
|
||||||
|
outer, context);
|
||||||
|
} else {
|
||||||
context.check_layout(os);
|
context.check_layout(os);
|
||||||
// special handling of font attribute changes
|
// special handling of font attribute changes
|
||||||
Token const prev = p.prev_token();
|
Token const prev = p.prev_token();
|
||||||
Token const next = p.next_token();
|
|
||||||
TeXFont const oldFont = context.font;
|
TeXFont const oldFont = context.font;
|
||||||
if (next.character() == '[' ||
|
if (next.character() == '[' ||
|
||||||
next.character() == ']' ||
|
next.character() == ']' ||
|
||||||
@ -2172,6 +2179,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
handle_ert(os, "}", context);
|
handle_ert(os, "}", context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (t.cat() == catEnd) {
|
else if (t.cat() == catEnd) {
|
||||||
if (flags & FLAG_BRACE_LAST) {
|
if (flags & FLAG_BRACE_LAST) {
|
||||||
|
Loading…
Reference in New Issue
Block a user