diaspora/diaspora — Issue #2213: Hashtags with underscores are not parsed correctly
Author: pixelistik
Created: 2011-10-20 12:02:34+00:00
State: open

If a hashtag contains two underscores, markdown formatting and hashtag parsing get in each other's way.

### Steps to produce the problem
* Start a new post or comment
* Enter this text: `This is a #Multi_Word_Hashtag`
* Post your entry.

### Result
The resulting link has a wrong URL: `https:///tags/Multi%3Cem%3EWord` and also the hashtag text is changed, to `#Multi_Word_Hashtag`, with only the first 2 words being part of the link.

### Expected

#### My preference
Handle underscores like dashes and make them work as part of a hashtag. The resulting link text would be unchanged `#Multi_Word_Hashtag` and the URL `https:///tags/Multi_Word_Hashtag`. `Word` is not in italics, formatting is ignored within hashtag.

#### Alternative: Graceful stop
Underscores terminate a hashtag, just like commas and periods. The resulting link text would be `#Multi` and the URL `https:///tags/Multi` The following text is parsed as usual, resulting in an italic formatting for `Word`

### Reference link
Check [this test post and comments](https://diasp.de/posts/18181) for some cases tried out.