[Remind-Fans] rem2html bug

hymie at lactose.homelinux.net hymie at lactose.homelinux.net
Wed Jan 13 09:20:38 EST 2016


Greetings.

I found a bug in rem2html.

The remind man page says

       The SHADE special replaces the psshade() function.  Use it like this:
            REM Sat Sun SPECIAL SHADE 128
            REM Mon SPECIAL SHADE 255 0 0
       The SHADE keyword is followed by either one or three numbers, from 0 to
       255.  If one number is supplied, it  is  interpreted  as  a  grey-scale
       value  from  black  (0) to white (255).  If three numbers are supplied,
       they are interpreted as RGB components  from  minimum  (0)  to  maximum
       (255).   The example above shades weekends a fairly dark grey and makes
       Mondays a fully-saturated red.  (These  shadings  appear  in  calendars
       produced by Rem2PS, tkremind and rem2html.)

but rem2html does not honor the one-number version, only the three-number
version.  This patch fixes it.

*** rem2html-orig    2015-04-17 01:57:55.000000000 -0400
--- rem2html    2016-01-13 09:17:24.150552974 -0500
***************
*** 257,262 ****
--- 257,266 ----
                        $shades->[$d] = sprintf("#%02X%02X%02X",
                                                ($1 % 256), ($2 % 256), ($3 % 256));
                }
+               elsif ($body =~ /^\s*(\d+)\s*$/) {
+                       $shades->[$d] = sprintf("#%02X%02X%02X",
+                                               ($1 % 256), ($1 % 256), ($1 % 256));
+               }
        } elsif ($special eq 'COLOR' || $special eq 'COLOUR') {
                if ($body =~ /(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/) {
                        my($r, $g, $b, $text) = ($1, $2, $3, $4);

--hymie!    http://lactose.homelinux.net/~hymie    hymie at lactose.homelinux.net



More information about the Remind-fans mailing list