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

Remove UTF-8 punctuation from hashtags and add test cases for hashtags #1546

Closed

Conversation

jonmarrs
Copy link
Contributor

@jonmarrs jonmarrs commented Sep 13, 2023

Patch 1:
damus-c: remove UTF-8 punctuation from hashtags
Check for UTF-8 punctuation in addition to regular punctuation in hashtags.
Examples of changes:

  • Handle multi-byte UTF-8 characters in addition to single-byte ASCII characters
  • Allow underscore (_) in hashtags
  • Allow Japanese wave dash (〜) in hashtags
  • Remove ellipsis (…) from hashtags
  • Remove currency symbols ($, £, ¥, €, ₿) from hashtags

Closes: #1518

Patch 2:
test: add test cases for ASCII and UTF-8 characters in hashtags

@jonmarrs
Copy link
Contributor Author

If you remove the recently added withAnimation(.bouncy) statements (16edc3f) from RelayConfigView.swift, the code should compile and run successfully.

@jb55
Copy link
Collaborator

jb55 commented Sep 13, 2023 via email

@jonmarrs jonmarrs force-pushed the 2023-08-hashtag-linked-punctuation branch from 76c0e16 to 56da2be Compare September 13, 2023 17:51
@jb55
Copy link
Collaborator

jb55 commented Sep 13, 2023 via email

Check for UTF-8 punctuation (such as ellipsis) in addition to regular punctuation in hashtags.

Closes: damus-io#1518
@jonmarrs jonmarrs force-pushed the 2023-08-hashtag-linked-punctuation branch from 56da2be to 2f32700 Compare September 13, 2023 21:18
@jonmarrs
Copy link
Contributor Author

peek_char returns -1 when out of bounds, but I don't see that handled here.

Ok. I am handling peek_char returning -1 now.

This was a bit confusing to review since it looks like these functions were moved unncessarily. Next time let's just add the new function under these ones.

Sorry about moving the functions, but I had to move them above my code to use them in my code.

I think this pull request should be ready to merge now. Let me know if there is anything else you want me to change.

-Jon

@jb55
Copy link
Collaborator

jb55 commented Sep 15, 2023 via email

@jb55 jb55 closed this in 617dee3 Sep 16, 2023
jb55 pushed a commit that referenced this pull request Sep 16, 2023
@jb55
Copy link
Collaborator

jb55 commented Sep 16, 2023 via email

@jb55 jb55 mentioned this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hashtag contains linked punctuation
2 participants