From 04b3b32a362f523250bd56ac56169d677c0b6c10 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 4 Feb 2020 14:03:21 -0800 Subject: [PATCH] simpler avoidance --- quad/quadwriter/attrs.rkt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/quad/quadwriter/attrs.rkt b/quad/quadwriter/attrs.rkt index 34e3df48..5acb33e2 100644 --- a/quad/quadwriter/attrs.rkt +++ b/quad/quadwriter/attrs.rkt @@ -20,7 +20,7 @@ [(? string? str) (match (regexp-match #px"^(-?[0-9\\.]+)\\s*([a-z]+)$" (string-downcase str)) [#false str] ; a string other than a dimension string, so leave it - [(list _ num-string unit) + [(list str num-string unit) ((match unit [(regexp #rx"(pt|point)(s)?$") values] ; points [(regexp #rx"in(ch(es)?)?$") in->pts] ; inches @@ -29,7 +29,7 @@ [(regexp #rx"ems?$") (if em-resolution-attrs (λ (num) (* (hash-ref em-resolution-attrs :font-size) num)) ;; if we don't have attrs for resolving the em string, we leave it alone - (λ (num) (format "~aem" num)))] ; em + (λ (num) str))] ; em [_ (raise-argument-error 'parse-dimension "dimension string" str)]) (string->number num-string))])])) (define (copy-block-attrs source-hash dest-hash) @@ -147,7 +147,6 @@ Naming guidelines keep-first-lines keep-last-lines - keep-all-lines keep-with-next