From 9e1882c4920bdafb599948f57a1d9dc65c24083d Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 8 Jul 2022 17:41:18 +0900 Subject: 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. --- lib/rack/show_exceptions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3-24-ge0c7