summaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authorThomas Park <thomas@thomaspark.co>2015-11-03 19:00:20 -0500
committerThomas Park <thomas@thomaspark.co>2015-11-03 19:00:20 -0500
commitf52bcffbfc8be533d6dd0173b0c30e4855932f46 (patch)
treed7ba2f32b751d81813036f3b3882ae3db37a7cd5 /assets/js
parent2606e1460c4b9b9e1bb585381f906b98aa941d2b (diff)
escape HTML entities in source viewer
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/custom.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/assets/js/custom.js b/assets/js/custom.js
index 5a9a6a55..d270087b 100644
--- a/assets/js/custom.js
+++ b/assets/js/custom.js
@@ -32,6 +32,12 @@
});
function cleanSource(html) {
+ html = html.replace(/×/g, "&close;")
+ .replace(/«/g, "&laquo;")
+ .replace(/»/g, "&raquo;")
+ .replace(/←/g, "&larr;")
+ .replace(/→/g, "&rarr;");
+
var lines = html.split(/\n/);
lines.shift();