##// END OF EJS Templates
FileLink: escape HTML unsafe characters from path...
Cristian Ciupitu -
Show More
@@ -2,6 +2,7 b''
2
2
3 Authors : MinRK, gregcaporaso, dannystaple
3 Authors : MinRK, gregcaporaso, dannystaple
4 """
4 """
5 from html import escape as html_escape
5 from os.path import exists, isfile, splitext, abspath, join, isdir
6 from os.path import exists, isfile, splitext, abspath, join, isdir
6 from os import walk, sep, fsdecode
7 from os import walk, sep, fsdecode
7
8
@@ -340,9 +341,10 b' class FileLink(object):'
340 self.result_html_suffix = result_html_suffix
341 self.result_html_suffix = result_html_suffix
341
342
342 def _format_path(self):
343 def _format_path(self):
343 fp = ''.join([self.url_prefix,self.path])
344 fp = ''.join([self.url_prefix, html_escape(self.path)])
344 return ''.join([self.result_html_prefix,
345 return ''.join([self.result_html_prefix,
345 self.html_link_str % (fp, self.path),
346 self.html_link_str % \
347 (fp, html_escape(self.path, quote=False)),
346 self.result_html_suffix])
348 self.result_html_suffix])
347
349
348 def _repr_html_(self):
350 def _repr_html_(self):
General Comments 0
You need to be logged in to leave comments. Login now