diff --git a/scripts/code-viewer.js b/scripts/code-viewer.js
index <HASH>..<HASH> 100644
--- a/scripts/code-viewer.js
+++ b/scripts/code-viewer.js
@@ -172,6 +172,7 @@
       let encoded = this.responseText;
       encoded = window.html_beautify(encoded, {indent_size: 2, wrap_line_length: 0});
       encoded = window.he.encode(encoded);
+      encoded = encoded.replace(/^\s*$\n/gm, ''); // Delete empty lines.
       codeViewer.encoded = encoded;
 
       if (codeViewer.tabActive === 'e') {
further beautification of html code in viewer