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

chat message can not show special characters #7240

Closed
ZhaoVitapublic opened this issue Jun 13, 2017 · 3 comments
Closed

chat message can not show special characters #7240

ZhaoVitapublic opened this issue Jun 13, 2017 · 3 comments

Comments

@ZhaoVitapublic
Copy link

We have a problem by sending chat message with special characters like _, * etc.
By sending messages, the markdown parser doesn't offer the escape opportunity to present some special character like _, etc..

For example , we want send a normal message with a word like "Bla_bla_123" in italic:

We expect to show as
Bla_bla_123,
but rocket chat shows the message like
Bla_bla_123_ .

Reference see following code on https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-markdown/markdown.js line 31:

// Support _text_ to make italics
msg = msg.replace(/(^|&gt;|[ >*~`])\_([^\_\r\n]+)\_([<*~`]|\B|\b|$)/gm, '$1<span class="copyonly">_</span><em>$2</em><span class="copyonly">_</span>$3');

Is there any possibility to handle this problem?

@localguru
Copy link
Contributor

localguru commented Jun 23, 2017

Can confirm, tested on demo.rocket.chat

_Bla_bla_123,_ becomes to Bla_bla_123,_

@martinvonwittich
Copy link

Yes, I'm also missing a general way to escape all Markdown special characters. GitHub allows this by prefixing any special characters with a backslash. For example:

_test_ becomes test
\_test\_ becomes _test_
\`\`\` becomes ```

@TwizzyDizzy
Copy link

@rocket-cat close

Closing this in favour of #8989.

Cheers
Thomas

@rocket-cat rocket-cat bot closed this as completed Apr 17, 2018
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

5 participants