mirror of https://github.com/dirtbags/moth.git
HTML-escape hexdump content so it doesn't break pages
This commit is contained in:
parent
fb566e406b
commit
81fc899c8b
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue