mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
curly_quotes now considers EM_DASH to be a space, so it uses an open quote after it.
Fixes #33 git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1449 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -607,6 +607,10 @@ void check_tagged(const String& str, bool check_balance) {
|
||||
|
||||
// ----------------------------------------------------------------------------- : Other utilities
|
||||
|
||||
bool is_space_like(Char c) {
|
||||
return isSpace(c) || c == _('(') || c == _('[') || c == _('{') || c == EN_DASH || c == EM_DASH;
|
||||
}
|
||||
|
||||
String curly_quotes(String str, bool curl) {
|
||||
bool open = true, in_tag = false;
|
||||
FOR_EACH(c, str) {
|
||||
@@ -620,7 +624,7 @@ String curly_quotes(String str, bool curl) {
|
||||
in_tag = false;
|
||||
} else if (!in_tag) {
|
||||
// Also allow double-nesting of quotes
|
||||
open = isSpace(c) || c == _('(') || c == _('[');
|
||||
open = is_space_like(c);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user