mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-25 18:37:47 +02: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')
|
application.jinja_env.add_extension('jinja2.ext.do')
|
||||||
|
|
||||||
def removeTerms(content, repository):
|
def removeTerms(content, repository):
|
||||||
for term in repository['terms']:
|
|
||||||
content = re.compile(term, re.IGNORECASE).sub("XXX", content)
|
|
||||||
repo = repository['repository']
|
repo = repository['repository']
|
||||||
if repo[-1] == '/':
|
if repo[-1] == '/':
|
||||||
repo = repo[0:-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 + "/blob/master", re.IGNORECASE).sub(
|
||||||
content = re.compile(repo, re.IGNORECASE).sub(self.public_url+"/repository/" + repository["id"], content)
|
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
|
return content
|
||||||
|
|
||||||
@application.template_filter('file_render', )
|
@application.template_filter('file_render', )
|
||||||
|
|||||||
Reference in New Issue
Block a user