current++;
char* attr_begin = current;
while (current < end && current[0] != '"') {
- if (current[0] == '&') {
- // process & > < " '
+ unichar u = ((string) current).get_char_validated ((long) (end - current));
+ if (u != (unichar) (-1)) {
+ current += u.to_utf8 (null);
} else {
- unichar u = ((string) current).get_char_validated ((long) (end - current));
- if (u != (unichar) (-1)) {
- current += u.to_utf8 (null);
- } else {
- Report.error (null, "invalid UTF-8 character");
- }
+ Report.error (null, "invalid UTF-8 character");
}
}
+ // TODO process & > < " '
string attr_value = ((string) attr_begin).ndup (current - attr_begin);
if (current >= end || current[0] != '"') {
// error
space ();
char* text_begin = current;
while (current < end && current[0] != '<') {
- if (current[0] == '&') {
- // process & > < " '
+ unichar u = ((string) current).get_char_validated ((long) (end - current));
+ if (u != (unichar) (-1)) {
+ current += u.to_utf8 (null);
} else {
- unichar u = ((string) current).get_char_validated ((long) (end - current));
- if (u != (unichar) (-1)) {
- current += u.to_utf8 (null);
- } else {
- Report.error (null, "invalid UTF-8 character");
- }
+ Report.error (null, "invalid UTF-8 character");
}
}
if (text_begin == current) {
return read_token (out token_begin, out token_end);
}
type = MarkupTokenType.TEXT;
+ // TODO process & > < " '
// string text = ((string) text_begin).ndup (current - text_begin);
}