-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not handle attributes with spaces in the content #33
Comments
This is unexpected thanks for the report! Update: I can reproduce this issue, most likely caused by using I'm not sure if I will be able to fix this soon. Would you be able to encode the space using |
ooxi
added a commit
that referenced
this issue
Jan 19, 2023
Open
I rewrote code like that and seems it works for my cases static char* xml_strtok_r(char *str, const char *delim, char **nextp) {
char *ret;
int in_quote = 0;
char quote_char = 0;
if (str == NULL) {
str = *nextp;
}
// Skip leading delimiters
str += strspn(str, delim);
if (*str == '\0') {
return NULL;
}
ret = str;
while (*str) {
if (!in_quote && strchr(delim, *str)) { // Found a delimiter outside quotes
*str++ = '\0';
break;
} else if ((*str == '"' || *str == '\'') && (in_quote == 0 || quote_char == *str)) {
in_quote = !in_quote; // Toggle in_quote
quote_char = in_quote ? *str : 0; // Set or reset quote_char
}
++str;
}
*nextp = str;
return ret;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gives an attribute foo with value "Has"
The text was updated successfully, but these errors were encountered: