fix osl list

This commit is contained in:
Aigio Liu
2021-03-04 00:40:55 +08:00
parent ef8afedab1
commit 05c63378a6
2 changed files with 8 additions and 2 deletions
@@ -65,10 +65,16 @@ namespace System
{
if (line.StartsWith("* "))
{
var name = line.Substring("[", "]");
if (string.IsNullOrWhiteSpace(line)) continue;
var index = line.IndexOf("]");
if (index < 0) continue;
var url = line[index..].Substring("(", ")");
if (string.IsNullOrWhiteSpace(url)) continue;
var item = new OpenSourceLibrary
{
Name = line.Substring("[", "]"),
Url = line.Substring("(", ")"),
Name = name,
Url = url,
};
const string githubUrl = "https://github.com/";
if (item.Url.StartsWith(githubUrl, StringComparison.OrdinalIgnoreCase))