Use unicode word chars to recognize hashtags in editor (#1296)
This commit is contained in:
parent
776a51734f
commit
f68e174aac
|
@ -300,7 +300,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject {
|
|||
.backgroundColor: UIColor.clear,
|
||||
.underlineColor: UIColor.clear],
|
||||
range: NSMakeRange(0, statusText.string.utf16.count))
|
||||
let hashtagPattern = "(#+[a-zA-Z0-9(_)]{1,})"
|
||||
let hashtagPattern = "(#+[\\w0-9(_)]{1,})"
|
||||
let mentionPattern = "(@+[a-zA-Z0-9(_).-]{1,})"
|
||||
let urlPattern = "(?i)https?://(?:www\\.)?\\S+(?:/|\\b)"
|
||||
|
||||
|
|
Loading…
Reference in New Issue