mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
tex2lyx: import straight quotation marks as ERT
This assures that they are output as straight quotations marks (e.g.,
babel shorthands).
Fixes: #75 [sic!]
(cherry picked from commit ccb9ae9670
)
This commit is contained in:
parent
3d6b8c0abb
commit
84b59c90e7
@ -2626,6 +2626,32 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
else if (t.cat() == catSpace || (t.cat() == catNewline && ! p.isParagraph()))
|
else if (t.cat() == catSpace || (t.cat() == catNewline && ! p.isParagraph()))
|
||||||
check_space(p, os, context);
|
check_space(p, os, context);
|
||||||
|
|
||||||
|
// babel shorthands (also used by polyglossia)
|
||||||
|
// Since these can have different meanings for different languages
|
||||||
|
// we import them as ERT (but they must be put in ERT to get output
|
||||||
|
// verbatim).
|
||||||
|
else if (t.asInput() == "\"") {
|
||||||
|
string s = "\"";
|
||||||
|
// These are known pairs. We put them together in
|
||||||
|
// one ERT inset. In other cases (such as "a), only
|
||||||
|
// the quotation mark is ERTed.
|
||||||
|
if (p.next_token().asInput() == "\""
|
||||||
|
|| p.next_token().asInput() == "|"
|
||||||
|
|| p.next_token().asInput() == "-"
|
||||||
|
|| p.next_token().asInput() == "~"
|
||||||
|
|| p.next_token().asInput() == "="
|
||||||
|
|| p.next_token().asInput() == "/"
|
||||||
|
|| p.next_token().asInput() == "~"
|
||||||
|
|| p.next_token().asInput() == "'"
|
||||||
|
|| p.next_token().asInput() == "`"
|
||||||
|
|| p.next_token().asInput() == "<"
|
||||||
|
|| p.next_token().asInput() == ">") {
|
||||||
|
s += p.next_token().asInput();
|
||||||
|
p.get_token();
|
||||||
|
}
|
||||||
|
output_ert_inset(os, s, context);
|
||||||
|
}
|
||||||
|
|
||||||
else if (t.character() == '[' && noweb_mode &&
|
else if (t.character() == '[' && noweb_mode &&
|
||||||
p.next_token().character() == '[') {
|
p.next_token().character() == '[') {
|
||||||
// These can contain underscores
|
// These can contain underscores
|
||||||
|
@ -97,6 +97,7 @@ What's new
|
|||||||
|
|
||||||
* TEX2LYX
|
* TEX2LYX
|
||||||
|
|
||||||
|
- Import straight quotations marks (e.g. babel shorthands) as ERT (bug 75).
|
||||||
|
|
||||||
|
|
||||||
* ADVANCED FIND AND REPLACE
|
* ADVANCED FIND AND REPLACE
|
||||||
|
Loading…
Reference in New Issue
Block a user