adjust the normalize-paste mixin to, by default,
replace non-breaking minus characters with hyphens closes PR 14197
This commit is contained in:
parent
d234c0c2e3
commit
35316fd72d
|
@ -427,11 +427,14 @@
|
||||||
|
|
||||||
@defmethod[(string-normalize [s string?]) string?]{
|
@defmethod[(string-normalize [s string?]) string?]{
|
||||||
Normalizes @racket[s]. Defaults to:
|
Normalizes @racket[s]. Defaults to:
|
||||||
@racketblock[(regexp-replace* #rx"\u200b"
|
@racketblock[(regexp-replace*
|
||||||
|
#rx"\u200b"
|
||||||
|
(regexp-replace*
|
||||||
|
#rx"\u2212"
|
||||||
(string-normalize-nfkc s)
|
(string-normalize-nfkc s)
|
||||||
|
"-")
|
||||||
"")]
|
"")]
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@defmixin[text:normalize-paste-mixin (text:basic<%>) (text:normalize-paste<%>)]{
|
@defmixin[text:normalize-paste-mixin (text:basic<%>) (text:normalize-paste<%>)]{
|
||||||
|
|
|
@ -1029,7 +1029,13 @@
|
||||||
[else
|
[else
|
||||||
(preferences:get 'framework:do-paste-normalization)]))
|
(preferences:get 'framework:do-paste-normalization)]))
|
||||||
(define/public (string-normalize s)
|
(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)
|
(define/override (do-paste start time)
|
||||||
(dynamic-wind
|
(dynamic-wind
|
||||||
|
|
Loading…
Reference in New Issue
Block a user