Browse Source

Prevent wrapping in code blocks

Use horizontal scrolling for long lines of code rather than wrapping.

Fix #467
George Cushen 7 years ago
parent
commit
a5a0037c68
1 changed files with 5 additions and 1 deletions
  1. 5 1
      layouts/partials/css/academic.css

+ 5 - 1
layouts/partials/css/academic.css

@@ -171,11 +171,15 @@ code {
 
 pre {
   margin: 0 0 1rem 0;
-  overflow: auto;
   background-color: rgb(248, 248, 248); /* Match default highlight theme. */
   border-color: rgb(248, 248, 248);
 }
 
+pre code {
+  white-space: pre; /* Override Bootstrap to preserve line breaks in code. */
+  overflow-x: auto;
+}
+
 hr {
   border: 0;
   height: 1px;