Skip to content

Commit bc62be0

Browse files
committed
fix: accented characters in sequence annotation break properly
1 parent dc1127d commit bc62be0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/components/SequenceAnnotator/index.story.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,17 @@ storiesOf("SequenceAnnotator", module)
114114
onChange={action("onChange")}
115115
/>
116116
))
117+
.add("Accented Characters", () => (
118+
<SequenceAnnotator
119+
type="label-sequence"
120+
document={`This should appear as a single word: aùbûcàdâeçfégèhêiëjïkîlôm (and not multiple letters)`}
121+
labels={[
122+
{
123+
color: colors[0],
124+
id: "test",
125+
displayName: "test"
126+
}
127+
]}
128+
onChange={action("onChange")}
129+
/>
130+
))

src/string-to-sequence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22

33
const stringToSequence = (doc: string) => {
4-
const sepRe = /[a-zA-Z]+/g
4+
const sepRe = /[a-zA-ZÀ-ÿ]+/g
55
let m
66
let indices = [0]
77
do {

0 commit comments

Comments
 (0)