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

Backslash not displayed when used in front of other special character. #6448

Open
xuv opened this issue Apr 4, 2018 · 5 comments
Open

Backslash not displayed when used in front of other special character. #6448

xuv opened this issue Apr 4, 2018 · 5 comments

Comments

@xuv
Copy link

xuv commented Apr 4, 2018

Description

When using the character '' (backslash) in front of another special character, the backslash is not displayed.

Steps to reproduce

  • type this: \o/ in the message box
  • \o/ is sent and displayed in sent messages.
  • type: ¯\_(ツ)_/¯ in the message box.
  • ¯_(ツ)_/¯ is sent and displayed in sent messages.

screen shot 2018-04-04 at 10 55 44

Version information

  • Platform: Desktop
  • OS: macOS
  • Version: 0.13.5
@lukebarnard1
Copy link
Contributor

lukebarnard1 commented Apr 5, 2018

This is because it's evaluated as markdown:

  • ¯\_(ツ)_/¯ in markdown is ¯_(ツ)_/¯ (see, GH does the same) because \_ is an escaped _
  • ¯\\\_(ツ)_/¯ in markdown is ¯\_(ツ)_/¯ because both the \ and _ are escaped (which makes sense because you want both to appear).

As a workaround, you can temporarily disable markdown by hitting ctrl + m or use ¯\\\_(ツ)_/¯.

This is similar to #4674.

We should address this though; users run into it a lot.

@xuv
Copy link
Author

xuv commented Apr 5, 2018

@lukebarnard1 Oh, thanks for the explanation... Makes sense. I see also where GH ate the \ I put in the first message.

@uhoreg
Copy link
Member

uhoreg commented Apr 5, 2018

Just throwing out a random idea, but maybe have some sort of indicator (e.g. highlighting the markdown button, or displaying a "preview" button?) when Riot detects that there is markdown notation (using the same method that it uses to check if it needs to send a formatted_body), to alert the user that what they send will not be exactly what they typed.

@lukebarnard1
Copy link
Contributor

lukebarnard1 commented Apr 6, 2018

@uhoreg we had similar ideas for automatically suggesting to the user that they need to escape room aliases for them not to be made italic.

Having a "preview" mode would be nice but detecting when to show it (instead of having an option to show it whilst composing) is not exactly trivial.

I'm now wondering whether we should do syntax highlighting to indicate where markdown will be used. Or perhaps we could apply inline formatting to show what the text would look like. The editor used to do this but it didn't to a great job so we removed the feature in favour of switching to rich mode.

@lampholder
Copy link
Member

Yeah, it's clear that there's a UX issue here to address, but it requires some thought on how to address it well.

I love the idea of (if it can be handled in a way that doesn't startle users unfamiliar with markdown) the composer popping up a preview if it detects markdown - @lukebarnard1 what's the challenge about identifying when there's markdown in the composer? (Alternatively we might always render the preview when in markdown mode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants