improve rendering of titles with empty numbers

This commit is contained in:
Matthew Flatt 2016-08-13 12:45:50 -06:00
parent 495630e001
commit 3e1c63c93a

View File

@ -72,13 +72,16 @@
#f)
(define/public (format-number number sep [keep-separator? #f])
(if (or (null? number)
(cond
[(or (null? number)
(andmap (lambda (x) (or (not x) (equal? x "")))
number)
(and (not (car number))
(not (ormap number? number))))
null
(cons (let ([s (string-append
null]
[else
(define result-s
(let ([s (string-append
(apply
string-append
(map (lambda (n)
@ -100,8 +103,10 @@
(pair? (car number))
(equal? s ""))
s
(substring s 0 (sub1 (string-length s)))))
sep)))
(substring s 0 (sub1 (string-length s))))))
(if (equal? result-s "")
null
(cons result-s sep))]))
(define/public (number-depth number)
(if (null? number)