diff --git a/src/handlers.js b/src/handlers.js index eeafc13..b02e09d 100644 --- a/src/handlers.js +++ b/src/handlers.js @@ -344,7 +344,7 @@ function(Filer, Async, Log, Content) { }, /** - * Send the raw file + * Send the raw file, making it somewhat more readable */ handleFile: function(path, fs) { fs.readFile(path, 'utf8', function(err, data) { @@ -353,7 +353,16 @@ function(Filer, Async, Log, Content) { this.handle404(path); return; } - _writeMarkup(data); + + // Escape the file a bit for inclusing in
...+ data = data.replace(/\/gm, '>') + .replace(/&/gm, '&'); + + var syntheticDoc = '' + + ' ' + + '
' + data + ''; + _writeMarkup(syntheticDoc); }); },