From 6b3a3c72c71aae36fd9c8200d9dc5655ce289b92 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 1 Mar 2014 14:38:11 -0800 Subject: [PATCH] explicit nbsp --- decode/typography-fast.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decode/typography-fast.rkt b/decode/typography-fast.rkt index dcecdcc..03b416d 100644 --- a/decode/typography-fast.rkt +++ b/decode/typography-fast.rkt @@ -27,9 +27,9 @@ ;; just store the query strings + replacement strings (define dashes ;; fix em dashes first, else they'll be mistaken for en dashes - ;; [\\s ] is whitespace + nonbreaking space - '((#px"[\\s ]*(---|—)[\\s ]*" "—") ; em dash - (#px"[\\s ]*(--|–)[\\s ]*" "–"))) ; en dash + ;; [\\s ] is whitespace + #\u00A0 is nonbreaking space + '((#px"[\\s#\u00A0]*(---|—)[\\s#\u00A0]*" "—") ; em dash + (#px"[\\s#\u00A0]*(--|–)[\\s#\u00A0]*" "–"))) ; en dash (define smart-quotes '((#px"(?<=\\w)'(?=\\w)" "’") ; apostrophe