Wiki: Inline LaTeX rendering fails for certain commands if it's not surrounded by text

Created on 10 Feb 2020  路  1Comment  路  Source: Requarks/wiki

Describe the bug
If a row in the markdown editor only is made up by some inline latex it will fail for certain commands.

A row consisting of only $\frac{1}{2}$ will fail and produce the output \frac{1}. If surrounded by text (text $\frac{1}{2}$ asdf) it will render succesfully. Interestingly enough both $\frac{1^{2}}{3^{4}}$ and $\frac{1}{3^{4}}$ will succeed while $\frac{1^{2}}{3}$ will fail which would lead me to believe it somehow is connected to the curly brackets?

The same goes for $\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$ which will by itself produce the output \begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end.

The inline LaTeX doesn't always fail when not surrounded by any text, for example a row consisting of $\int_{-\infty}^\infty x^{ix} dx$ renders just fine.

To Reproduce
Steps to reproduce the behavior:

  1. Write a row in markdown editor consisting of only $\frac{1}{2}$.
  2. View the page.

Expected behavior
All LaTeX should render.

Screenshots
The code

## Inline LaTeX error

$\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$

text $\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$ text

$\frac{1}{3}$

text $\frac{1}{3}$ text

$\frac{1^{2}}{3^{4}}$

$\frac{1}{3^{4}}$

$\frac{1^{2}}{3}$

the output:

image

Host Info (please complete the following information):

  • OS: Ubuntu 18.04, Docker
  • Wiki.js version: 2.1.110
  • Database engine: postgres 11.6
bug contrib-medium

Most helpful comment

When formular ends with right brace, and the inline formular does not surrounding by some (non-spacing) text, it would rendering fail.

鍥剧墖
鍥剧墖

I think issue #1952 is relevant.

>All comments

When formular ends with right brace, and the inline formular does not surrounding by some (non-spacing) text, it would rendering fail.

鍥剧墖
鍥剧墖

I think issue #1952 is relevant.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

axisofentropy picture axisofentropy  路  4Comments

den1622 picture den1622  路  3Comments

sbonaime picture sbonaime  路  3Comments

touhoku-japan picture touhoku-japan  路  3Comments

ramirahikkala picture ramirahikkala  路  3Comments