+sub dispdash {
+ my $code = shift;
+ my ($prefix, @dots) = $code =~ m/\A(-?)(\d)(\d)/ or return $code;
+ my ($w, $h) = (max(6, 4 * max(@dots)), 9);
+ my ($w0, $w1) = ($w / $dots[0], $dots[1] ? $w / $dots[1] : 1);
+ return sprintf(
+ '<svg height="20"%s viewBox="-.5 -.5 %s %s">'
+ . '<path d="%s" /></svg>',
+ $prefix && ' style="opacity:.5"',
+ $w + 1, $h + 1, join(' ',
+ "m0,$h l+$w0,-$h" x $dots[0], # slashes
+ "m0,$h l-$w1,-$h" x $dots[1], # backslashes
+ )
+ );
+}
+