mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
replace first the url before the terms
This commit is contained in:
@@ -53,13 +53,14 @@ class Anonymous_Github:
|
||||
application.jinja_env.add_extension('jinja2.ext.do')
|
||||
|
||||
def removeTerms(content, repository):
|
||||
for term in repository['terms']:
|
||||
content = re.compile(term, re.IGNORECASE).sub("XXX", content)
|
||||
repo = repository['repository']
|
||||
if repo[-1] == '/':
|
||||
repo = repo[0:-1]
|
||||
content = re.compile(repo + "/blob/master", re.IGNORECASE).sub(self.public_url + "/repository/" + repository["id"], content)
|
||||
content = re.compile(repo, re.IGNORECASE).sub(self.public_url+"/repository/" + repository["id"], content)
|
||||
content = re.compile(repo + "/blob/master", re.IGNORECASE).sub(
|
||||
self.public_url + "/repository/" + repository["id"], content)
|
||||
content = re.compile(repo, re.IGNORECASE).sub(self.public_url + "/repository/" + repository["id"], content)
|
||||
for term in repository['terms']:
|
||||
content = re.compile(term, re.IGNORECASE).sub("XXX", content)
|
||||
return content
|
||||
|
||||
@application.template_filter('file_render', )
|
||||
|
||||
Reference in New Issue
Block a user