Rocket.chat: KaTeX parse error inside code block

Created on 21 Feb 2019  路  5Comments  路  Source: RocketChat/Rocket.Chat

My Setup

  • Operating System: MacOS
  • App Version: 2.14.7
  • Installation type: dmg

  • [x] I have tested with the latest version
  • [x] I can simulate the issue easily

Description

insert following code to the conversation:

var OPEN_TAG = /\[%/;

Current Behavior

Message shows as code block with following error inside:

var OPEN_TAG = /
KaTeX parse error: Expected 'EOF', got '%' at position 22: 鈥 CLOSE_TAG = /%滩
/;

Expected Behavior

Message shows as code block without any KaTeX error inside:

var OPEN_TAG = /\[%/;
message message rendering bug

Most helpful comment

KaTeX should not act on any code blocks or inline code items. Those are supposed to be rendered verbatim in a monospace font, perhaps with colors, per the Markdown standard. It's not just code that gets messed up by KaTeX. Even typing a dollar sign in plain text seems to trigger the bug, and there is no obvious escape sequence to type a literal dollar sign. Please fix this ASAP.

All 5 comments

@iegik Do we want that rather than rendering katex parse error in the output block of katex messages, It should render the input message in the katex box?

Some example instances I ran into today...

image

image

@savish28 I think, that will be nice to leave errored message "as is" and append KaTeX error bellow the message block.
To be sure, user understanding where error occurs - we may underline place where it occurs.

KaTeX should not act on any code blocks or inline code items. Those are supposed to be rendered verbatim in a monospace font, perhaps with colors, per the Markdown standard. It's not just code that gets messed up by KaTeX. Even typing a dollar sign in plain text seems to trigger the bug, and there is no obvious escape sequence to type a literal dollar sign. Please fix this ASAP.

I agree with @gloriouschaos, code blocks and inline code should have no further rendering applied to them, since (aside from unintended code triggering formatting) it becomes impossible to do something like show the verbatim text one would use to achieve a certain format/rendering appearance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lunitic picture lunitic  路  3Comments

sta-szek picture sta-szek  路  3Comments

marceloschmidt picture marceloschmidt  路  3Comments

tanc picture tanc  路  3Comments

Kiran-Rao picture Kiran-Rao  路  3Comments