#5252·hedgedoc

LaTeX Display Mode Breaks Syntax Highlighting

Author: davidaugustatCreated Nov 20, 2023Updated Oct 1, 2026
Labelsstatus: confirmed

Description

When you use the LaTeX display mode with the dollar signs in the same line as the equation, this breaks the syntax highlighting in the editor view for the rest of the document.

Steps to reproduce

Example:

markdown
# Has highlighting
$$x$$

# Has no highlighting

image

However, when the dollar signs are in separate lines, the syntax highlighting is not broken:

markdown
# Has highlighting
$$
x
$$

# Also has highlighting

image

Expected behaviour

Using LaTeX display mode should not break the syntax highlighting, even when the dollar signs are in the same line.

In scientific environments, it is common to keep the dollar signs for a LaTeX display mode equation in the same line as the equation itself.

Logs

No response

Config

No response

Your Setup

  • Host OS: [e.g. Ubuntu 20.04]
  • NodeJS version: [run node --version]
  • HedgeDoc version: (Click "Releases" in the footer)

Additional context

No response