never surrender

pull/218/head
Matthew Butterick 5 years ago
parent b4ebdb8947
commit d743f76bd6

@ -1 +1 @@
1566501806
1566862068

@ -28,6 +28,8 @@
(define tricky-string "\"Why,\" she could've asked, \"are we in Oahu watching 'Mame'?\"")
(check-equal? (smart-quotes tricky-string)
"“Why,” she couldve asked, “are we in Oahu watching Mame?”")
(check-equal? (smart-quotes "\"what's in it for me?\",")
"“whats in it for me?”,")
(check-equal? (smart-quotes tricky-string
#:apostrophe "zing"
#:double-open "«" #:double-close "»"
@ -53,8 +55,10 @@
(define quotes
`((#px"(?<=\\w)'(?=\\w)" ,apostrophe-str) ; apostrophe
(#px"(?<!\\w)'(?=[,.:;?!])" ,single-close-str) ; sentence ender on outside exceptions
(#px"(?<!\\w)'(?=\\S)" ,single-open-str) ; single_at_beginning
(#px"(?<=\\S)'(?!\\w)" ,single-close-str) ; single_at_end
(#px"(?<!\\w)\"(?=[,.:;?!])" ,double-close-str) ; sentence ender on outside exceptions
(#px"(?<!\\w)\"(?=\\S)" ,double-open-str) ; double_at_beginning
(#px"(?<=\\S)\"(?!\\w)" ,double-close-str))) ; double_at_end

Loading…
Cancel
Save