chars: query overflow error as debug message
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 21 Apr 2018 16:44:49 +0000 (18:44 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 10 May 2018 14:49:06 +0000 (16:49 +0200)
Resulting match can be very long as well, so hide it for users.
Allow error messages to be force wrapped to fit.

base.css
chars.plp

index 8703c83f9f59bb945e80581bb154525a34d01f87..cd09f2dfeaa460d8204bf87b05867c9a05f73b40 100644 (file)
--- a/base.css
+++ b/base.css
@@ -101,8 +101,10 @@ ul {
 }
 
 pre {
-       display: inline-block;
        text-align: left;
+       margin: 2ex auto;
+       white-space: pre-wrap;
+       overflow-wrap: break-word;
 }
 body > pre {
        width: 78ch;
@@ -111,6 +113,7 @@ body > pre {
        padding: 0 1em;
        border-width: 0 1px;
        border-style: solid;
+       white-space: pre;
 }
 
 h2 small {
index 6605ec8c6d051e492ffdae311600b3dc2727e6f6..bea56cfe3973afd29e3202819bc1408bcc8874b5 100644 (file)
--- a/chars.plp
+++ b/chars.plp
@@ -89,8 +89,8 @@ for (map { split /[^\d-]/ } $query) {
 @chars or Abort("No match for query $query", '404 no results');
 
 @chars <= 1500 or Abort(
-       sprintf('Too many matches (%d) for query %s', scalar @chars, $query),
-       '403 not allowed',
+       sprintf('Too many matches (%d) for query', scalar @chars),
+       '403 not allowed', $query
 );
 
 # output character list