Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly parsed linked in message body #464

Closed
germain-gg opened this issue Jan 18, 2023 · 1 comment
Closed

Incorrectly parsed linked in message body #464

germain-gg opened this issue Jan 18, 2023 · 1 comment
Labels

Comments

@germain-gg
Copy link

Describe the bug

IMG_0714

On yesterday's latest test flight

@stefanceriu
Copy link
Member

Caused by NSRegularExpression/NSDataDetector not knowing how to deal properly with unicode scalars.

(lldb) po string
"Hello. 🙂 Not sure if you saw https://github.com/vector-im/element-web/issues/24229"

(lldb) po string.count
82

(lldb) po (string as NSString).length
83

(lldb) po range
▿ {0, 83}
  - location : 0
  - length : 83

(lldb) po MatrixEntityRegex.linkRegex.matches(in: string, options: [], range: range)
▿ 1 element
  - 0 : <NSLinkCheckingResult: 0x600003c27720>{30, 53}{https://github.com/vector-im/element-web/issues/24229}

where I changed the range to be NSRange(location: 0, length: (attributedString.string as NSString).length) instead of NSRange(location: 0, length: attributedString.string.count)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants