summary refs log tree commit
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-07-08 17:41:18 +0900
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2022-07-09 15:29:44 +1200
commit9e1882c4920bdafb599948f57a1d9dc65c24083d (patch)
tree76ea8b01ecdfabd9f7b6d9d8c4e3b2a97151e6c2
parent3400fb5cd925915a677aa3a26b8db07130bd4b16 (diff)
downloadrack-9e1882c4920bdafb599948f57a1d9dc65c24083d.tar.gz
Use "pre" format and monospace font for exception messages
Ruby 3.1's error_highlight feature prints a code snippet with a
underline. To make it readable, an exception message should be rendered
by a monospace font and in "pre" format, i.e., whitespaces are preserved
and newlines are respected.
-rw-r--r--lib/rack/show_exceptions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rack/show_exceptions.rb b/lib/rack/show_exceptions.rb
index 5f2bd7fb..6af1ec1f 100644
--- a/lib/rack/show_exceptions.rb
+++ b/lib/rack/show_exceptions.rb
@@ -163,7 +163,7 @@ module Rack
           div.commands { margin-left: 40px; }
           div.commands a { color:black; text-decoration:none; }
           #summary { background: #ffc; }
-          #summary h2 { font-weight: normal; color: #666; }
+          #summary h2 { font-family: monospace; font-weight: normal; color: #666; white-space: pre; }
           #summary ul#quicklinks { list-style-type: none; margin-bottom: 2em; }
           #summary ul#quicklinks li { float: left; padding: 0 1em; }
           #summary ul#quicklinks>li+li { border-left: 1px #666 solid; }