Avoid URL fragment in base URL, since the webview won’t accept that as a base URL. Fix #32.
This commit is contained in:
parent
e4da1b4716
commit
5ed5e8825b
|
@ -60,7 +60,15 @@ class ArticleRenderer {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if let url = URL(string: s!) {
|
var urlComponents = URLComponents(string: s!)
|
||||||
|
if urlComponents == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can’t use url-with-fragment as base URL. The webview won’t load. See scripting.com/rss.xml for example.
|
||||||
|
urlComponents!.fragment = nil
|
||||||
|
|
||||||
|
if let url = urlComponents!.url {
|
||||||
if url.scheme == "http" || url.scheme == "https" {
|
if url.scheme == "http" || url.scheme == "https" {
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue