RocketChat / RocketChat/Rocket.Chat

KaTeX parse error: Expected 'EOF'

Open
#10,126 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

message rendering type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Posting shell escape sequences brings a KaTeX parse error

Server Setup Information:
  • Version of Rocket.Chat Server: 0.62.1
  • Operating System: Debian GNU/Linux 9.4 (stretch)
  • Deployment Method(snap/docker/tar/etc): snap
  • Number of Running Instances: ?
  • DB Replicaset Oplog: ?
  • Node Version: v8.8.1
  • mongoDB Version: ?
Steps to Reproduce:

Post something like
export PS1='\[\033[00;30m\]\[\033[47m\]\h [\D{%d.%m.%y} \t]\[\033[40m\] \[\033[01;33m\]\w \[\033[01;35m\]$ \[\033[00m\]'

Expected behavior:

Text should be shown as entered

Actual behavior:

you will get:

export PS1='
KaTeX parse error: Expected 'EOF', got '\0' at position 1: \̲0̲33[00;30m
KaTeX parse error: Expected 'EOF', got '\0' at position 1: \̲0̲33[47m
\h [\t]
KaTeX parse error: Expected 'EOF', got '\0' at position 1: \̲0̲33[40m
KaTeX parse error: Expected 'EOF', got '\0' at position 1: \̲0̲33[01;33m
\w
KaTeX parse error: Expected 'EOF', got '\0' at position 1: \̲0̲33[01;35m
$
KaTeX parse error: Expected 'EOF', got '\0' at position 1: \̲0̲33[00m
'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by posting the provided shell prompt in Rocket.Chat and inspect the message-rendering path where KaTeX parses the content. The fix is complete when the full escape sequence is displayed as entered without KaTeX parse errors; no file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.