Commit 2cd81659 authored by Rico Tzschichholz's avatar Rico Tzschichholz

vala: Add MarkupReader.from_string() and support add support for "percnt;"

parent 5259f229
......@@ -61,6 +61,18 @@ public class Vala.MarkupReader {
}
}
public MarkupReader.from_string (string filename, string content) {
this.filename = filename;
begin = content;
end = begin + content.length;
current = begin;
line = 1;
column = 1;
}
public string? get_attribute (string attr) {
return attributes[attr];
}
......@@ -108,6 +120,9 @@ public class Vala.MarkupReader {
return MarkupTokenType.END_ELEMENT;
}
content = null;
name = null;
space ();
MarkupTokenType type = MarkupTokenType.NONE;
......@@ -243,6 +258,11 @@ public class Vala.MarkupReader {
content.append_c ('>');
current += 4;
text_begin = current;
} else if (((string) next_pos).has_prefix ("percnt;")) {
content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
content.append_c ('%');
current += 8;
text_begin = current;
} else {
current += u.to_utf8 (null);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment