adjust the normalize-paste mixin to, by default,

replace non-breaking minus characters with hyphens

closes PR 14197

original commit: 35316fd72d637209c8c75068498055d6362a2e0c
This commit is contained in:
Robby Findler 2013-11-24 22:18:57 -06:00
parent 595631d266
commit 3cd3d931c2
2 changed files with 14 additions and 5 deletions

View File

@ -427,11 +427,14 @@
@defmethod[(string-normalize [s string?]) string?]{
Normalizes @racket[s]. Defaults to:
@racketblock[(regexp-replace* #rx"\u200b"
(string-normalize-nfkc s)
"")]
@racketblock[(regexp-replace*
#rx"\u200b"
(regexp-replace*
#rx"\u2212"
(string-normalize-nfkc s)
"-")
"")]
}
}
@defmixin[text:normalize-paste-mixin (text:basic<%>) (text:normalize-paste<%>)]{

View File

@ -1029,7 +1029,13 @@
[else
(preferences:get 'framework:do-paste-normalization)]))
(define/public (string-normalize s)
(regexp-replace* #rx"\u200b" (string-normalize-nfkc s) ""))
(regexp-replace*
#rx"\u200b"
(regexp-replace*
#rx"\u2212"
(string-normalize-nfkc s)
"-")
""))
(define/override (do-paste start time)
(dynamic-wind