Fix stringified value and key writing for quotes
This commit is contained in:
parent
8077bbfa1f
commit
3e7bae969e
3 changed files with 21 additions and 3 deletions
|
@ -227,7 +227,7 @@ abstract class Tag {
|
|||
if (getKey() == "") {
|
||||
return false;
|
||||
} else {
|
||||
String letters = "abcdefghijklmnopqrstuvwxyz";
|
||||
String letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
for (int i = 0; i < getKey().length; i++) {
|
||||
String digit = getKey().substring(i, i + 1);
|
||||
if (letters.indexOf(digit) == -1) {
|
||||
|
@ -238,6 +238,21 @@ abstract class Tag {
|
|||
}
|
||||
}
|
||||
|
||||
bool shouldQuote(String value) {
|
||||
if (value == "") {
|
||||
return false;
|
||||
} else {
|
||||
String letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
for (int i = 0; i < value.length; i++) {
|
||||
String digit = value.substring(i, i + 1);
|
||||
if (letters.indexOf(digit) == -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void writeStringifiedValue(StringBuilder builder, int indent, bool isList);
|
||||
void readStringifiedValue(StringReader reader);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue