From 5ab18e0db869c7b48d19d8630c0fcae048fede30 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 26 Mar 2015 13:33:36 -0600 Subject: [PATCH] scriblb/bibtex: fix author parsing Closes #2. --- scribble-lib/scriblib/bibtex.rkt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scribble-lib/scriblib/bibtex.rkt b/scribble-lib/scriblib/bibtex.rkt index 54c1b282..82d3fb97 100644 --- a/scribble-lib/scriblib/bibtex.rkt +++ b/scribble-lib/scriblib/bibtex.rkt @@ -221,13 +221,16 @@ [(list one) (org-author-name one)] [(list one two) (author-name one two)] [(list-rest first rest) - (author-name first (apply string-append (add-between rest " ")))]))))) + (author-name (apply string-append (add-between (cons first (drop-right rest 1)) + " ")) + (last rest))]))))) (module+ test (require rackunit) ;; use this as a predicate to hack around lack of - ;; ability to use equal? on author element structs + ;; ability to use equal? on author element structs; + ;; unfortunately, it ony compares the composed strings (define (print-as-equal-string? a b) (equal? (format "~s" a) (format "~s" b)))