Why Nostr? What is Njump?
2023-05-14 20:10:34
in reply to

Vivek on Nostr: Hey tyiu The following solution may possibly work. I am not an expert in iOS app ...

Hey

The following solution may possibly work. I am not an expert in iOS app development (in fact never done it). So, please take what I say with a pinch of salt :D

The call flow in damus goes like this from my preliminary analysis of the code on Github 👇

```
damus.c :: parse_hashtags ==>
cursor.h :: consume_until_boundary ==>
cursor.h :: is_boundary

```

I believe the fix is to change how the `is_boundary` function is implemented in damus.

When we look at the implementation of hashtags from the other clients, the regular expression based matching does not have any check for alphanumerics, but instead just a set of 'prohibited characters' (a black list)

Amethyst regex is this:

```java
"#([^\\s!@#\$%^&*()=+./,\\[{\\]};:'\"?><]+)(.*)"
```

Snort regex is this:

```js
/(#[^\s!@#$%^&*()=+.\/,\[{\]};:'"?><]+)/
```

Both of these regexes try to just write a blacklist of chars that can't be there in a hashtag, instead of whitelisting alphanumerics.

If, in c code, we can come up with a function that will check for blacklisted characters and return a boolean, we could use this to implement international hashtags in damus too.

Not sure if my theory is correct.
Author Public Key
npub1ltx67888tz7lqnxlrg06x234vjnq349tcfyp52r0lstclp548mcqnuz40t