Skip to content

Commit 6a51ace

Browse files
author
Wayne Wanbok Choi
committed
Make parameters removing special characters
1 parent 2140ed0 commit 6a51ace

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/POEditorParser/Lib/LiteralsParser.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ struct Variable {
2929
- alreadyReadPages <- this should not be captialized (or we'll lose the Read and Pages capital letters)
3030
*/
3131

32-
let words = rawKey.split(separator: " ").map(String.init)
32+
let words = rawKey
33+
.components(separatedBy: .alphanumerics.inverted)
34+
.flatMap { $0.split(separator: " ") }
35+
.map(String.init)
3336
if words.count == 1 {
3437
return words[0].lowercaseFirst
3538
}

0 commit comments

Comments
 (0)