RocketChat / RocketChat/Rocket.Chat

Missing test cases for KaTeX dollar syntax and option gating in message-parser

Open
#39,096 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

The current katex.test.ts only has 2 test cases and only covers parenthesis syntax (\[...\] and \(...\)).

Missing test cases include:

  • Dollar syntax ($$...$$) block KaTeX
  • Dollar syntax ($...$) inline KaTeX
  • Option gating — KaTeX delimiters treated as plain text when options are disabled

This weakens confidence in KaTeX parsing behavior, especially relevant ahead of the planned parser rewrite where test coverage is critical.

Steps to reproduce:
  1. Open packages/message-parser/tests/katex.test.ts
  2. Observe only 2 test cases exist
  3. Dollar syntax and option gating have no test case
Expected behavior:

KaTeX parsing should have test coverage for all supported syntax variants and option flags.

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

Start with packages/message-parser/tests/katex.test.ts, where the existing two parenthesis-syntax cases are defined. Add coverage for $$...$$ block syntax, $...$ inline syntax, and disabled-option behavior where delimiters remain plain text. Done means the supported syntax variants and option gating are each covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.