static ChangelogEntry CreateChangelogEntry(ChangelogVersion version, HtmlNode n) { string type = null; string title = null; var data = Clean(n.InnerHtml); var match = rxChangelogEntry.Match(data); if (match.Success) { type = match.Groups[1].Value; title = match.Groups[2].Value; // description = title.split index1 to end? } else { match = rxChangelogEntry2.Match(data); if (match.Success) { type = match.Groups[1].Value; title = match.Groups[2].Value; } else title = data; } return new ChangelogEntry {Title = title, Type = TryParseChangeType(type), Version = version}; }
static ChangelogVersion HandleChangelogEntries(HtmlNode child, ChangelogVersion version) { if (child.Name == "ul") { foreach (var n in child.ChildNodes.Where(x => x.Name == "li")) version.Entries.Add(CreateChangelogEntry(version, n)); version = null; } return version; }
static ChangelogVersion HandleChangelogVersionWithEntries(HtmlNode child, ChangelogVersion version, Changelog changelog) { version = HandleChangelogVersion(child, changelog, version); version = HandleChangelogEntries(child, version); return version; }
static ChangelogVersion HandleChangelogVersion(HtmlNode child, Changelog changelog, ChangelogVersion version) { if (child.Name == "h3") { version = CreateChangelogVersion(changelog, child); changelog.Versions.Add(version); } return version; }
static ChangelogVersion HandleOlderSection(HtmlNode child, ChangelogVersion version, Changelog changelog) { if (child.Name == "div" && child.Attributes["class"].Value.Contains("older")) { version = null; foreach (var n2 in child.ChildNodes) version = HandleChangelogVersionWithEntries(n2, version, changelog); version = null; } return version; }