mirror of https://github.com/adamdruppe/arsd.git
another nonstrict end of file test
This commit is contained in:
parent
848566eaf7
commit
cf4547219b
15
dom.d
15
dom.d
|
@ -2220,7 +2220,7 @@ dchar parseEntity(in dchar[] entity) {
|
||||||
case "fnof": return '\u0192';
|
case "fnof": return '\u0192';
|
||||||
case "circ": return '\u02C6';
|
case "circ": return '\u02C6';
|
||||||
case "tilde": return '\u02DC';
|
case "tilde": return '\u02DC';
|
||||||
|
case "trade": return '\u2122';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3340,6 +3340,9 @@ class Document : FileResource {
|
||||||
} else
|
} else
|
||||||
data = rawdata;
|
data = rawdata;
|
||||||
|
|
||||||
|
static if(is(Utf8Stream == string))
|
||||||
|
return data;
|
||||||
|
else
|
||||||
return new Utf8Stream(data);
|
return new Utf8Stream(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3625,9 +3628,14 @@ class Document : FileResource {
|
||||||
case '/': // closing an element
|
case '/': // closing an element
|
||||||
pos++; // skip the start
|
pos++; // skip the start
|
||||||
auto p = pos;
|
auto p = pos;
|
||||||
while(data[pos] != '>')
|
while(pos < data.length && data[pos] != '>')
|
||||||
pos++;
|
pos++;
|
||||||
//writefln("</%s>", data[p..pos]);
|
//writefln("</%s>", data[p..pos]);
|
||||||
|
if(pos == data.length && data[pos-1] != '>')
|
||||||
|
if(strict)
|
||||||
|
throw new MarkupException("File ended before closing tag had a required >");
|
||||||
|
else
|
||||||
|
data ~= ">"; // just hack it in
|
||||||
pos++; // skip the '>'
|
pos++; // skip the '>'
|
||||||
|
|
||||||
string tname = data[p..pos-1];
|
string tname = data[p..pos-1];
|
||||||
|
@ -5481,6 +5489,9 @@ struct FormFieldOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
// this needs to look just like a string, but can expand as needed
|
// this needs to look just like a string, but can expand as needed
|
||||||
|
version(no_dom_stream)
|
||||||
|
alias string Utf8Stream;
|
||||||
|
else
|
||||||
class Utf8Stream {
|
class Utf8Stream {
|
||||||
protected:
|
protected:
|
||||||
// these two should be overridden in subclasses to actually do the stream magic
|
// these two should be overridden in subclasses to actually do the stream magic
|
||||||
|
|
Loading…
Reference in New Issue