From 3cd3d931c283d96f36d3f85dd93c2536bab34a71 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 24 Nov 2013 22:18:57 -0600 Subject: [PATCH] adjust the normalize-paste mixin to, by default, replace non-breaking minus characters with hyphens closes PR 14197 original commit: 35316fd72d637209c8c75068498055d6362a2e0c --- .../gui-pkgs/gui-doc/scribblings/framework/text.scrbl | 11 +++++++---- pkgs/gui-pkgs/gui-lib/framework/private/text.rkt | 8 +++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/gui-pkgs/gui-doc/scribblings/framework/text.scrbl b/pkgs/gui-pkgs/gui-doc/scribblings/framework/text.scrbl index 9fdf2a9c..6406a935 100644 --- a/pkgs/gui-pkgs/gui-doc/scribblings/framework/text.scrbl +++ b/pkgs/gui-pkgs/gui-doc/scribblings/framework/text.scrbl @@ -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<%>)]{ diff --git a/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt b/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt index b99c9cff..2d10afba 100644 --- a/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt +++ b/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt @@ -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