mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-09 05:21:13 +02:00
Auto-add http: to URLs starting with //.
This commit is contained in:
parent
e477a9870d
commit
d1b73b9a6a
1 changed files with 2 additions and 0 deletions
|
|
@ -209,6 +209,8 @@ def getConfigSectionFor(url):
|
|||
def getClassFor(url):
|
||||
## fix up leading protocol.
|
||||
fixedurl = re.sub(r"(?i)^[htp]+(s?)[:/]+",r"http\1://",url.strip())
|
||||
if fixedurl.startswith("//"):
|
||||
fixedurl = "http:%s"%url
|
||||
if not fixedurl.startswith("http"):
|
||||
fixedurl = "http://%s"%url
|
||||
## remove any trailing '#' locations.
|
||||
|
|
|
|||
Loading…
Reference in a new issue