Skip to main content


Parens in Tags


!Friendica Support
In future versions of Friendica, is it possible to not include parens (specifically close parens) in tags the same way you can't use other punctuation? (so that this doesn't #happen)
Maybe Lisp programmers need parens in tags? πŸ˜‰
or you can have them but they #|Must be enclosed in pipes)|
@helpers
@Jonathan Lamothe Yes, it would require some clever Regular Expression skill to only include matching parentheses, we already do it for the autolinker, but it's black magic to me.
@Hypolite Petovan Is there a context in which it makes sense to include any parens in a hashtag, matching or not?

@Jonathan Lamothe We have a pretty lax policy when it comes to hashtags. We accept letters, numbers and special characters including spaces (even though I don't think we match them, but I can see them in the autocompletion from received posts' tags).

We could tighten the accepted range to exclude some characters, but how do you decide which ones?

@Hypolite Petovan I mean, for matching when a post is made, I'd personally stick with alphanumeric (plus perhaps underscore?)

If you want to add other characters, perhaps some kind of notation for deliberately doing that, such as @screwlisp's suggestion here? (which may have been tongue-in-cheek, but...)


or you can have them but they #|Must be enclosed in pipes)|
@helpers

@Hypolite Petovan Fair point. Alphanumeric and anything non-ASCII then?
@Jonathan Lamothe Sure, but that includes several punctuation and special characters, and I'd rather not have to whack-a-mole my way through the Unicode pages. A matching parentheses regular expression sounds less daunting.
@Hypolite Petovan I guess in the meantime, I'll just (keep doing #this ). πŸ™ƒ

@Jonathan Lamothe @Hypolite Petovan so what actually would be needed is the regex to exclude all the unwanted characters, like parenthesis or no width space and then whenever we find some character that should terminate a tag we can add it to the regex.

@Hypolite Petovan out of interest, do you know where this is done in the code?

@utzer [Friendica] @Jonathan Lamothe I do, but again this requires us to make a decision about what characters can or cannot be used in a hashtag, something we have never done so far.
@Hypolite Petovan yes I know, but we could start with some basics that are annoying... "zero width space" and brackets would be something... oh and dots.
@Jonathan Lamothe
⇧