From 81fc899c8b71c5f4d679a3c0f15d86ed74e95a77 Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Thu, 27 Sep 2018 16:07:03 -0500 Subject: [PATCH] HTML-escape hexdump content so it doesn't break pages --- devel/moth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devel/moth.py b/devel/moth.py index 6ba2646..bcd0e32 100644 --- a/devel/moth.py +++ b/devel/moth.py @@ -4,6 +4,7 @@ import argparse import contextlib import glob import hashlib +import html import io import importlib.machinery import mistune @@ -244,7 +245,7 @@ class Puzzle: self.body.write(' ') self.body.write(' '.join(hexes[8:])) self.body.write(' |') - self.body.write(''.join(chars)) + self.body.write(html.escape(''.join(chars))) self.body.write('|\n') offset += len(chars) self.body.write('{:08x}\n'.format(offset))