Merge pull request #48 from int00h5525/topics/url_escape_hexdump

Topics/HTML escape hexdump
This commit is contained in:
Neale Pickett 2018-09-28 08:00:44 -06:00 committed by GitHub
commit 3b5e89c3f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import argparse
import contextlib import contextlib
import glob import glob
import hashlib import hashlib
import html
import io import io
import importlib.machinery import importlib.machinery
import mistune import mistune
@ -244,7 +245,7 @@ class Puzzle:
self.body.write(' ') self.body.write(' ')
self.body.write(' '.join(hexes[8:])) self.body.write(' '.join(hexes[8:]))
self.body.write(' |') self.body.write(' |')
self.body.write(''.join(chars)) self.body.write(html.escape(''.join(chars)))
self.body.write('|\n') self.body.write('|\n')
offset += len(chars) offset += len(chars)
self.body.write('{:08x}\n'.format(offset)) self.body.write('{:08x}\n'.format(offset))