Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 33e24166ee | |||
| 6588647286 |
@@ -30,5 +30,8 @@ let exampleEmojis: [String: EmojiSource] = [
|
||||
|
||||
// aliases
|
||||
"banana": .alias("banana_dance"),
|
||||
"parrot": .alias("party_parrot")
|
||||
"parrot": .alias("party_parrot"),
|
||||
|
||||
// unicode inside shortcode
|
||||
"�": .character("😊")
|
||||
]
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'Streamoji'
|
||||
s.version = '0.1.7'
|
||||
s.version = '0.1.8'
|
||||
s.summary = 'Custom emoji rendering library for iOS apps with support for GIF & images.'
|
||||
|
||||
s.swift_version = '5.2'
|
||||
|
||||
@@ -41,7 +41,7 @@ extension NSAttributedString {
|
||||
}
|
||||
ranges.append(NSRange(location: lastMatchIndex, length: length - lastMatchIndex))
|
||||
|
||||
let regex = try? NSRegularExpression(pattern: ":(\\w|-|\\+)+:", options: [])
|
||||
let regex = try? NSRegularExpression(pattern: ":(\\w|[^\\x00-\\x7F]+|-|\\+)+:", options: [])
|
||||
let matchRanges = ranges.map { range in regex?.matches(in: string, options: [], range: range).map { $0.range(at: 0) } ?? [] }
|
||||
return matchRanges.reduce(into: [NSRange]()) { $0.append(contentsOf: $1) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user