bool ProcessScript (TagType tagtype, TagAttributes attributes)
{
if (tagtype != TagType.Close) {
if (attributes != null && attributes.IsRunAtServer ()) {
string language = (string) attributes ["language"];
if (language != null && language.Length > 0 && tparser.ImplicitLanguage)
tparser.SetLanguage (language);
CheckLanguage (language);
string src = (string) attributes ["src"];
if (src != null) {
if (src.Length == 0)
throw new ParseException (Parser,
"src cannot be an empty string");
string content = ReadFile (src);
inScript = true;
TextParsed (Parser, content);
FlushText ();
inScript = false;
if (tagtype != TagType.SelfClosing) {
ignore_text = true;
Parser.VerbatimID = "script";
}
} else if (tagtype == TagType.Tag) {
Parser.VerbatimID = "script";
inScript = true;
}
return true;
} else {
if (tagtype != TagType.SelfClosing) {
Parser.VerbatimID = "script";
javascript = true;
}
string content = location.PlainText;
/* HACK, HACK, HACK */
if (content.StartsWith ("<script")) {
TextParsed (location, "<script");
content = content.Substring (7);
}
TextParsed (location, content);
return true;
}
}
bool result;
if (inScript) {
result = inScript;
inScript = false;
} else if (!ignore_text) {
result = javascript;
javascript = false;
TextParsed (location, location.PlainText);
} else {
ignore_text = false;
result = true;
}
return result;
}