1 2 3 4 5 6 7 8 9 10 11 12 | import re
class RemoveSelfLinks:
def process_response(self, request, response):
if response.status_code == 200:
link = request.META['PATH_INFO']
response.content = \
re.sub( \
r'<a([^>]+)href="%s"([^>]*)>(.*?(?!</a>)[^<]*)</a>' % link, \
r'<span \1 \2>\3</span>', \
response.content)
return response
|
More like this
- @reply links in Twitter messages by ryanberg 3 years, 10 months ago
- Page numbers with ... like in Digg by Ciantic 3 years, 1 month ago
- True links in the admin list by svetlyak 4 years, 8 months ago
- YUI Loader as Django middleware by akaihola 4 years, 1 month ago
- More information about users and groups in user admin by ramusus 2 years, 10 months ago
Comments