Skip to content

Conversation

@ghamerly
Copy link
Contributor

@ghamerly ghamerly commented Jan 3, 2020

Fixes #162

cgi.escape() would cause "<" to become "&lt;", which would then get
rendered by plasTeX as "&amp;lt;". Removing cgi.escape() fixes the
issue.

One other change rolled into this commit is a necessary change to
listingsutf8.py to read input files properly.

Fixes Kattis#162

cgi.escape() would cause "<" to become "&lt;", which would then get
rendered by plasTeX as "&amp;lt;". Removing cgi.escape() fixes the
issue.

One other change rolled into this commit is a necessary change to
listingsutf8.py to read input files properly.
I.e. do not use any escaping for python3/plastex2

Also, use io.open with encoding=utf-8 rather than using decode('utf-8')
@ghamerly
Copy link
Contributor Author

ghamerly commented Jan 6, 2020

Commit 2ccd713 differentiates between python2 and python3 (as a proxy for the version of plasTeX, which does not seem to advertise its version as far as I can see). For py2, we retain the use of cgi.escape(); for py3 we do not. I've tested this on a few problems.

@ghamerly
Copy link
Contributor Author

ghamerly commented Jan 7, 2020

Commit e94d3a6 fixes an unrelated bug I found; python3 does not have the file() command.

@ghamerly ghamerly requested a review from pehrsoderman January 22, 2020 15:44
@ghamerly
Copy link
Contributor Author

Merging as these changes are essential for running properly under python3.

@ghamerly ghamerly merged commit 8d362e5 into Kattis:develop Jan 31, 2020
@ghamerly ghamerly deleted the remove-cgi-escape branch March 2, 2020 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plasTeX2 (py3) renders sample data incorrectly

2 participants