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

don't interpret underscores to mean 'italic' when used in the middle of a word. #1758

Open
raboof opened this issue Sep 20, 2018 · 6 comments
Labels
A-Composer A-Pills P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@raboof
Copy link

raboof commented Sep 20, 2018

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

  • Platform: web (in-browser)

For the web app:

  • Browser: Firefox 61.0.1
  • OS: Debian Linux
  • URL: riot.im/app
@t3chguy
Copy link
Member

t3chguy commented Sep 20, 2018

This is the behaviour of CommonMark

Related element-hq/element-web#6434 element-hq/element-web#3534

@ara4n
Copy link
Member

ara4n commented Sep 20, 2018

dup element-hq/element-web#4674

@ara4n ara4n closed this as completed Sep 20, 2018
@raboof
Copy link
Author

raboof commented Sep 20, 2018

I'm not sure this is really a duplicate of element-hq/element-web#4674 because that is specifically about URL's and this is a non-URL string. A fix for element-hq/element-web#4674 may or may not fix this case.

@ara4n
Copy link
Member

ara4n commented Sep 20, 2018

Yup, you're right - it's actually a regression of element-hq/element-web#3428. It's probably very similar to element-hq/element-web#4674 but may not be. Will reopen.

@ara4n ara4n reopened this Sep 20, 2018
@lampholder
Copy link
Member

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

element-hq/element-web#4674 (comment) 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?)

@lampholder lampholder added T-Defect P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Sep 21, 2018
@raboof
Copy link
Author

raboof commented Sep 21, 2018

What are/is pills/pilling?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Composer A-Pills P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

6 participants