Open raboof opened 6 years ago
This is the behaviour of CommonMark
Related https://github.com/vector-im/riot-web/issues/6434 https://github.com/vector-im/riot-web/issues/3534
I'm not sure this is really a duplicate of vector-im/element-web#4674 because that is specifically about URL's and this is a non-URL string. A fix for vector-im/element-web#4674 may or may not fix this case.
Yup, you're right - it's actually a regression of https://github.com/vector-im/riot-web/issues/3428. It's probably very similar to vector-im/element-web#4674 but may not be. Will reopen.
Right, so commonmark (I believe) does the 'right thing' for underscores in the middle of words.
The problem is, it looks like commonmark doesn't consider # a word character: reference impl of commonmark showing the difference.
Fwiw, GFM has exactly the same issue: #ircnet#hsnijmegen:irc.snt.utwente.nl
https://github.com/vector-im/riot-web/issues/4674#issuecomment-355850720 outlines some possible solutions. I'd really like us to stick to an agreed markdown standard; could we address this with some creative pilling (by which I mean turning all aliases to pills and then mandating our own formatting?)
What are/is pills/pilling?
Description
When displaying a string that contains underscores, such as
#_ircnet_#hsnijmegen:irc.snt.utwente.nl
, the underscores are removed and the 'ircnet' fragment is shown in italic ("#ircnet#hsnijmegen:irc.snt.utwente.nl").It would be nicer to leave underscores be when encountered in the middle of a word, and only convert them to italic when they are added on word boundaries.
Version information
For the web app: