fix: improve URL parsing and title extraction in getFilenameFromContent

This commit is contained in:
Arik Jones (aider)
2024-09-19 16:33:55 -05:00
parent 237ed512fc
commit 32499abbc0
2 changed files with 15 additions and 4 deletions

View File

@@ -76,7 +76,9 @@ func TestGetFilenameFromContent(t *testing.T) {
{"No title here", "http://example.com/page", "example_com_page.rollup.md", false},
{"<title> Trim Me </title>", "http://example.com", "Trim_Me.rollup.md", false},
{"<title></title>", "http://example.com", "example_com.rollup.md", false},
{"<title> </title>", "http://example.com", "example_com.rollup.md", false},
{"Invalid URL", "not a valid url", "", true},
{"No host", "http://", "", true},
}
for _, test := range tests {