Remove curly quotes for MWS and apprentice export

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1038 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-02 20:43:45 +00:00
parent de0817099a
commit 76d2eb7d42
5 changed files with 31 additions and 18 deletions
+1 -16
View File
@@ -267,22 +267,7 @@ SCRIPT_FUNCTION(format) {
SCRIPT_FUNCTION(curly_quotes) {
SCRIPT_PARAM_C(String, input);
bool open = true, in_tag = false;
FOR_EACH(c, input) {
if (c == _('\'') || c == LEFT_SINGLE_QUOTE || c == RIGHT_SINGLE_QUOTE) {
c = open ? LEFT_SINGLE_QUOTE : RIGHT_SINGLE_QUOTE;
} else if (c == _('\"') || c == LEFT_DOUBLE_QUOTE || c == RIGHT_DOUBLE_QUOTE) {
c = open ? LEFT_DOUBLE_QUOTE : RIGHT_DOUBLE_QUOTE;
} else if (c == _('<')) {
in_tag = true;
} else if (c == _('>')) {
in_tag = false;
} else if (!in_tag) {
// Also allow double-nesting of quotes
open = isSpace(c) || c == _('(') || c == _('[');
}
}
SCRIPT_RETURN(input);
SCRIPT_RETURN(curly_quotes(input,true));
}
// regex escape a string