Fix in scrub_relative_urls
This commit is contained in:
parent
55a9dea264
commit
78ef561f41
1 changed files with 2 additions and 2 deletions
|
|
@ -6,8 +6,8 @@ import frappe, re
|
|||
|
||||
def scrub_relative_urls(html):
|
||||
"""prepend a slash before a relative url"""
|
||||
html = re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html)
|
||||
html = re.sub("""url\((?!http|ftp|/|#)([^\(\)]+)\)""", 'url(/\g<1>)', html)
|
||||
html = re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#|%|{)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html)
|
||||
html = re.sub("""url\((?!http|ftp|/|#|%|{)([^\(\)]+)\)""", 'url(/\g<1>)', html)
|
||||
return html
|
||||
|
||||
def can_cache(no_cache=False):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue