iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.67k stars 277 forks source link

Inconsistent behaviour with GitHub on escaped backslashes in maths environment #669

Open Jackaed opened 4 months ago

Jackaed commented 4 months ago

Describe the bug When a double backslash is placed in a maths environment, the GitHub markdown render treats this as it would treat a normal, single backslash, whereas markdown-preview treats this as a newline.

This is a VERY niche inconsistency but it matters in my particular use-case because mdformat decides to escape all backslashes placed, including in maths environments. This can be fixed using mdformat-myst but that isn't yet published on NixOS so I can't use it (I'm attempting to get it packaged).

As issues go, this is about as low priority as they come.

To Reproduce Steps to reproduce the behavior:

  1. Place a double backslash in a maths equation in a markdown file
  2. Open the preview
  3. See that it is treated as a newline

Expected behavior Follow GitHub's behaviour on this and treat it as a normal backslash in the maths environment.

Desktop (please complete the following information):