Skip to content

Commit

Permalink
Fix for jrjohansson#15
Browse files Browse the repository at this point in the history
  • Loading branch information
bjmorgan committed Mar 22, 2021
1 parent 14879f2 commit 6462864
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions version_information/version_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"""
import cgi
import html
import json
import sys
import time
Expand Down Expand Up @@ -122,20 +123,20 @@ def _repr_json_(self):

def _repr_html_(self):

html = "<table>"
html += "<tr><th>Software</th><th>Version</th></tr>"
html_str = "<table>"
html_str += "<tr><th>Software</th><th>Version</th></tr>"
for name, version in self.packages:
_version = cgi.escape(version)
html += "<tr><td>%s</td><td>%s</td></tr>" % (name, _version)
_version = html.escape(version)
html_str += "<tr><td>%s</td><td>%s</td></tr>" % (name, _version)

try:
html += "<tr><td colspan='2'>%s</td></tr>" % time.strftime(timefmt)
html_str += "<tr><td colspan='2'>%s</td></tr>" % time.strftime(timefmt)
except:
html += "<tr><td colspan='2'>%s</td></tr>" % \
html_str += "<tr><td colspan='2'>%s</td></tr>" % \
time.strftime(timefmt).decode(_date_format_encoding())
html += "</table>"
html_str += "</table>"

return html
return html_str

@staticmethod
def _latex_escape(str_):
Expand Down

0 comments on commit 6462864

Please sign in to comment.