RocketChat / RocketChat/Rocket.Chat
Renering issue when mixing markdown and KaTeX in the same message
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
When mixing markdown and KaTeX in the same block, you can end up breaking valid KaTeX in favor of the markdown by using backticks.
Server Setup Information:
- Version of Rocket.Chat Server: 0.58.2
- Operating System: Ubuntu 16.04 - x86_64
- Deployment Method(snap/docker/tar/etc): snap
- Number of Running Instances: 1
- DB Replicaset Oplog: N/A
- Node Version: v4.8.3
Steps to Reproduce:
- Type:
\[ ` x = \sqrt y + 1 \] ` - Send it
Expected behavior:
I expected to see a single "smart quote" within a KaTeX block, and then a single backtick following the rendered KaTeX!
Actual behavior:
You get no KaTeX and a weird codeblock! 
Note:
The same trick works to break the rendering with triple-backticks, but that was difficult to put in markdown such that it rendered correctly on github. Here's the rendered image though:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report names no source file or test. Start by reproducing the exact mixed Markdown and KaTeX input in Rocket.Chat, then trace the rendering entry point; done means KaTeX renders correctly and the following backtick remains outside the rendered block.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100